[erlang-questions] erlang process schedule
Jan Lehnardt
jan@REDACTED
Mon Jan 19 16:19:30 CET 2009
On 19 Jan 2009, at 03:35, Kaiduan Xie wrote:
> Hi,
>
> Can anyone give a systematic view on how erlang schedules process?
> Joe's "Programming Erlang" gives details on how fast an erlang
> process is created/destroyed; unfortunately it does not elaborate
> how erlang process is scheduled, and how fast is the process switch.
> (We all konw thread context switch in C/Java is not cheap)
Processes run for a fixed number of "reductions" until they cat
stopped and the next one gets executed. This happens round-robin.
There is one optimisation that when a process sends a message to
another one, the sending process gets stopped and the remaining
reductions go to the called process. Switching processes is as fast as
increasing a pointer in the array that keeps track of all processes.
Cheers
Jan
--
More information about the erlang-questions
mailing list