[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Erlang implementation fun...

Mike Salib <msalib@mit.edu> writes:

> My other question is whether Erlang offers any realtime garuntees. If
> so, how do implementations manage interactions between the kernel's
> scheduling garuntees and the Erlang scheduler garuntees?

No, it doesn't.

I think you could call it best-effort (or "soft real-time".) The
scheduler does pass control around frequently, and having some
processes do heavy lifting doesn't starve the rest, but there are no
guarantees (and no doubt if you start swapping virtual memory etc
you'd see real delays.)

The rule of thumb for Erlang programmers is that you can expect things
to happen within about a millisecond of when they're supposed to
(e.g. 'after' timeouts in receives), and the scheduler makes its
best-effort to make this happen. This is a tremendous luxury compared
with other languages in my experience :-) and evidently the scheduler
implementation is good enough for high-end telecomms systems (<-
obligatory Erlang real-world boast ;-))