[concurrency-interest] Deadlock detection

Oliver Zeigermann oliver at zeigermann.de
Fri Apr 6 17:32:32 EDT 2007


2007/4/6, Szabolcs Ferenczi <szabolcs.ferenczi at gmail.com>:
> On 06/04/07, Oliver Zeigermann <oliver at zeigermann.de> wrote:
>
> > The manager would signal a deadlock to the thread using an exception.
> > The thread then is resonsible for undoing a set of actions and
> > releasing all its locks in order to resolve the deadlock. Both
> > releasing the locks and undoing all actions can be supported by the
> > manager. Undoing all actions of a thread is the equivalent to rolling
> > back a transaction in a DB system. This scenario only makes sense when
> > the actions done by the thread are restricted to those undoable by the
> > manager.
>
> To me it looks like you are transforming a possible deadlock into a
> possible livelock. How do you think this algorithm would respond to
> the dining philosophers scenario?

Each philospher would be represented as one thread. When a
philosopher's action would cause a deadlock, the manager could tell it
so using an exception. The philosopher should react accordingly and
tell the manager to return all locks. Now another philosopher that
originally waited for the first one can finish its work. So, there is
no live lock either. Another approach would be that the manager does
all the rolling back and the thread only gets notified about that.

Oliver


More information about the Concurrency-interest mailing list