Possible deadlock and solution

Gyepi SAM gyepi at praxis-sw.com
Fri Sep 27 21:58:37 CEST 2002


On Fri, Sep 27, 2002 at 07:57:04PM +0200, Matthias Andree wrote:
> On Fri, 27 Sep 2002, Gyepi SAM wrote:
> 
> > The solution:
> > 
> > Ensure that register_words always locks the databases in the same order by

> The real solution when you're about to lock two items that may be
> interdependent is to do this (pseudo code):

Yes, in the general case, you are correct, but we're talking about
a known interdependency and a specific place where the deadlock could occur.

There are other solutions also, but all would increase the length of time that we hold
the locks.

Note that to simplify the API, the locks are requested in blocking mode and failure
to acquire the lock is an error. This is obviously not the correct way in the general case,
but for the context we are using it, it makes sense.

-Gyepi



More information about the bogofilter-dev mailing list