Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-02-19 17:35:02


Gottlob Frege wrote:
> On 2/19/07, Frank Mori Hess <fmhess_at_[hidden]> wrote:
>>
>> Yes, I think the strong disconnect() guarantee will also guarantee
>> the deadlock you outlined earlier with two slots attempting to
>> disconnect each other will always be possible.
>>
>
> I think the strong guarantee is much more important. If I say
> disconnect() I really don't expect calls after that.

Does this imply that concurrent invocations are implicitly serialized at
slot level?

This guarantee makes sense for a use pattern where one has

X * px = new X;

and bind(&X::f, px) as a slot. Now thread 1 calls the signal and thread 2
disconnects the slot and immediately issues a delete px after that.

I wouldn't have written the code in such a way, though. A shared_ptr<X> as
px would work regardless of whether disconnect() guaranteed no calls after
return.


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