in reply to Re^2: perl5 road map?
in thread perl5 road map?
The thing is that in Erlang ... create processes (it doesn't have threads)
Sorry, but you are wrong. Erlang does use threads.
- Firstly: Erlang processes are actually 'green threads'.
That is, user-space execution contexts, running in shared memory space, managed by an custom-written, in-process scheduler.
- Secondly: Since the release of R13B in 2006; as a result of the realisation that green threading didn't scale on modern hardware -- whether multi-processor SMP or multi-core SMP or a combination of the two -- Erlang now uses kernel threads internally, in order to achieve scalable concurrency.
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: perl5 road map?
by zwon (Abbot) on Mar 24, 2012 at 17:20 UTC | |
by BrowserUk (Patriarch) on Mar 24, 2012 at 23:01 UTC | |
by xiaoyafeng (Deacon) on Mar 25, 2012 at 08:31 UTC | |
by Happy-the-monk (Canon) on Mar 25, 2012 at 09:15 UTC |