|
Boost Users : |
From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2007-02-18 13:27:40
On Sunday 18 February 2007 01:08 pm, Timmo Stange wrote:
> Frank Mori Hess wrote:
> > On Sunday 18 February 2007 12:08 am, Gottlob Frege wrote:
> >> - do you hold any locks DURING the slot call? That's typically bad,
> >> since you have no idea what else is locked or what a slot might do,
> >> so deadlocks abound.
> >
> > Well, neither implementation will deadlock, except for lock-ordering
> > problems between external mutexes and the ones inside the signals
> > implementation. I've got a list lock and a slot lock, and only the
> > slot lock is held while the slot is executing. I took care that it is
> > safe to do a blocking lock on the list lock while a slot lock is
> > already held, and the slot lock itself is recursive so I don't see any
> > deadlocks.
>
> Consider two slots which will mutually disconnect the other in a
> situation of concurrent signal invocation. With each thread holding
> the lock of either slot (because of the invocation), neither would
> be able to disconnect the other - a deadlock.
I stand corrected, my deadlock detector must need tune-up. Dropping the
slot mutex before executing has made this deadlock go away too though.
-- Frank
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net