[erlang-questions] How does Erlang schedule process?

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Tue Mar 8 19:03:45 CET 2016


On Tue, Mar 8, 2016 at 6:12 PM, Jung Kim <jungkkr@REDACTED> wrote:

> So I am interested to know how Erlang schedule process without the user
> inserting code like coroutine.yield() in the function created.


Two observations:

* Every loop has to use a tail-call.
* The interpreter automatically inserts a yield at every 2000 function
calls.

Of course, if you end up waiting for a message and none has arrived, you
are put on a sleep queue until such a message arrives.

More here:

http://jlouisramblings.blogspot.dk/2013/01/how-erlang-does-scheduling.html
.. it is still somewhat up-to-date with the current state-of-the-art.


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160308/61d48c55/attachment.htm>


More information about the erlang-questions mailing list