Erlang (was: Re: Generics)

Lex Spoon lex at cc.gatech.edu
Tue Nov 11 19:09:41 UTC 2003


Ned Konz <ned at bike-nomad.com> wrote:
> I don't recall. The preemption is pretty simple: if there's a higher priority 
> process that's ready to run when the VM checks, the current process gets 
> suspended. Which puts it at the end of the list for that priority.

Interesting.  Looking at #synchronousSignal:, which is the way that
threads get woken up, that seems to be the current semantics.  I don't
really like this, however; I would rather that the active process of
each priority stays active until it is blocked one way or another.  It
should still be cheap to explicitly send a process to the end of its
list.

Incidentally, something to observe is that Squeak makes heavy use of
*lists* of processes.  So suspending a process means traversing the
entire list to put it at the end.  This would probably cause problems if
you had even single thousands of processes.

On the other hand, all this code is simple and is available.  It is
quite amenable to tweaking, should someone want to work out something
better.  Along the way, it would seem easy to add a #preemptable flag to
processes, that the VM could notice.  There are benefits to having such
a straightforward and open VM as we have!


-Lex



More information about the Squeak-dev mailing list