The thing is that in Erlang ... create processes (it doesn't have threads)
Sorry, but you are wrong. Erlang does use threads.
That is, user-space execution contexts, running in shared memory space, managed by an custom-written, in-process scheduler.
For a little more detail of the history and reasoning, please see one I prepared earlier.
And see the Erlang development team paper: "Inside the Erlang VM: with focus on SMP. Prepared by Kenneth Lundin, Ericsson AB Presentation held at Erlang User Conference, Stockholm, November 13, 2008 ". (I linked to the PDF in the earlier reference.)
here's an example from Erlang Programming that creates 10000 processes (in the book they actually starting at 100000):
Yes. And the Go language proponents promote that it can do the same thing:
package main import ("flag"; "fmt") var ngoroutine = flag.Int("n", 100000, "how many") func f(left, right chan int) { left <- 1 + <-right } func main() { flag.Parse(); leftmost := make(chan int); var left, right chan int = nil, leftmost; for i:= 0; i< *ngoroutine; i++ { left, right = right, make(chan int); go f(left, right); } right <- 0; // bang! x := <-leftmost; // wait for completion fmt.Println(x); // 100000 }
The Mercedes CLK63 AMG Black has so much power that Jeremy Clarkson (Top Gear) managed to sustain a power-slide for so long that he completely destroyed a brand new pair of £1,000/pair rear tyres in about 10 minutes. It was spectacular to watch; and I bet it was fun to do; but as a measure of the utility of the vehicle, it is entirely pointless!
And the same goes for both the Erlang and Go threading demos. They are entirely useless as demonstrations of anything practical or useful.
In reply to Re^3: perl5 road map?
by BrowserUk
in thread perl5 road map?
by xiaoyafeng
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |