Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Erlang's processes are just threads implemented to act like processes is this correct?


Erlang's processes are not native threads or native processes. In a sense, they are "green processes" multiplexed M:N on native threads.


Basically they're processes within the VM that the VM manipulate the native threads?

Are there any good books on this subject?

Thanks.


Depending on how deep you want to go:

http://jlouisramblings.blogspot.com/2013/01/how-erlang-does-...

BTW, this is the author of the program and the article!

Heck checkout out all his posts, they are fantastic.

Here is my quick try at it:

Try to think of Erlang VM as a mini operating system. Erlang processes are then OS processes.

If your operating system is modern it lets you launch more processes than you have CPUs.

Also if one process crashes it doesn't affect others. This is pretty cool and useful. Anyone remember how much fun it was to run Windows 3.1 or Windows 95? Your game crashes and your word processor got screwed as well as a side effect. That is pretty primitive. We got better tools than that (Linux, Windows, etc). So this takes you a long way as far as the analogy works. Erlang processes have the same properties.

The only difference is that while you can probably have hundreds or maybe thousands OS processes on a large system, you can have many hundreds of thousands or even millions of Erlang processes. They are really lightweight (a couple of KB of memory only when they start up). The VM is a really awesome piece of engineering because it makes it all possible while also preserving isolated heaps (memory).


Erlang and OTP in action is my favorite, as it cuts to the parts that I as a distributed systems engineer really wanted to learn. http://learnyousomeerlang.com/ is one of the most commonly recommended guides/books.


http://learnyousomeerlang.com/ is excellent, and you can read it online or buy a paper version.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: