Things to Know About Erlang Processes
In Erlang, processes belong to the programming language and NOT the operating system. You must know that:
- Creating and destroying processes is very fast.
- Sending messages between processes is very fast.
- Processes behave the same way on all operating systems.
- We can have very large numbers of processes.
- Processes share no memory and are completely independent.
- The only way for processes to interact is through message passing.
To run efficiently an Erlang program in a multi-core CPU, we have to try to do the following:
- Use lots of processes.
- Avoid side effects.
- Avoid sequential bottlenecks.
- Write "small messages, big computations" code.
Reference:
Joe Armstrong.
Programming Erlang: Software for a Concurrent World.
Pragmatic Bookshelf, 2007.
ISBN: 193435600X.
pp. 141 and 368.