Tutorial by Examples

We create a new concurrent process by calling the spawn function. The spawn function will get as parameter a function Fun that the process will evaluate. The return value of the spawn function is the created process identifier (pid). 1> Fun = fun() -> 2+2 end. #Fun<erl_eval.20.52032458&gt...
Two erlang processes can communicate with each other, wich is also known as message passing. This procedure is asynchronous in the form that the sending process will not halt after sending the message. Sending Messages This can be achieved with the construct Pid ! Message, where Pid is a valid pr...
It is possible to register a process (pid) to a global alias. This can be achieved with the build in register(Alias, Pid) function, where Alias is the atom to access the process as and Pid is the process id. The alias will be globally available! It is very easy to create shared state, wich is usu...

Page 1 of 1