Concurrent Futures

Ralph Johnson johnson at cs.uiuc.edu
Sun Oct 28 13:36:05 UTC 2007


On 10/28/07, Rob Withers <reefedjib at yahoo.com> wrote:
> There is no danger of deadlock.  It is impossible, since there are no
> Semaphores.

This does not compute.  It is like saying "There is no danger of
murder, since there are no guns."  There are many ways of having
deadlock without semaphores.  Deadlock is possible in an asynchronous
messaging system.  An algorithm might be waiting for an event that
will never occur.

I think the real answer is that there is no way to have a deadlock,
because there is no way to wait.  Programs can only busy-wait, so
deadlock problems all get converted into starvation problems.  This
might not be very efficient on a machine with a large number of
processes running on a small number of processors, but becomes
efficient as the process/processor ration drops.

An Andreas' solution, a philosopher who can't pick up a fork will drop
one that he already has, and will wait a random amount of time.  This
has the possibility of starvation, but with possibility 0 as time goes
to infinity.

-Ralph



More information about the Squeak-dev mailing list