3 ms·
"Erlang based systems obtain many of the aforementioned properties from the Erlang concurrency model. Erlang handles the concurrency itself instead of relying o
by lucaspiller 13y ago
"Erlang based systems obtain many of the aforementioned properties from the Erlang concurrency model. Erlang handles the concurrency itself instead of relying on the OS. A concurrent entity in Erlang, called Erlang process, is much lighter than a standard OS process or thread, initially using about 3 KB of memory on a 64bit system. In a typical Erlang systems, you can easily create hundreds of thousands or maybe even millions of Erlang processes. The Erlang virtual machine uses its own scheduler which ensures that each process gets a fair share of execution time. The scheduler also distributes processes over available CPU cores, using as few OS threads as possible (by default only as much as the number of available CPU cores)."
http://www.theerlangelist.com/2012/12/yet-another-introduction-to-erlang.html http://www.theerlangelist.com/2012/12/yet-another-introducti...
It is kind of like Node in that it is very easy to do concurrent stuff, except instead of nested callbacks and all that jazz, you write 'processes' which are designed to share nothing. They run akin to OS threads in that one process crashing won't bring down the whole system (unlike Node). As no state is shared it also means that they can easily (i.e. it is built into the VM, and switched on by default) be scaled up to run over many cores. If you are interested, you might want to look at Elixir (a language built on top of the Erlang VM) which has a more Ruby-esque syntax: http://elixir-lang.org/ http://elixir-lang.org/
EDIT: Should also point out that I think "Jessica's" comment was just trolling, however it isn't far from the truth :)
- _nato_ 13y agoIs ``Jessica's'' comment not far from the truth because Scala and Go have shared memory for their Actors/Processes? I know Erlang doesn't share memory between their processes which leads to concurrency; is this what she was getting at?
- lucaspiller 13y agoI haven't played around with Scala or Go, but it's not far from the truth in that Erlang is a pretty good bet.
- rdtsc 13y agoIn general (apart from run time code loading) one can accomplish a lot of things Erlang does in any language. Her "how much pain and when" I think implies that she only accepts concurrency as practical when units of concurrency are isolated as that would reduce the number of shared data structures being updated, lock contentions and so on. There is some truth in there that I agree with. But then again maybe she was just trolling. I for one do not like her tone her comment.
- blacktulip 13y agoThank you very much!