From: Howard Hinnant (hinnant_at_[hidden])
Date: 2007-08-22 12:29:13
On Aug 22, 2007, at 11:22 AM, Yuval Ronen wrote:
> Howard Hinnant wrote:
>> On Aug 22, 2007, at 8:05 AM, Yuval Ronen wrote:
>>> Yuval Ronen wrote:
>>>> Howard Hinnant wrote:
>>>>> Because of this, it is
>>>>> not possible (in the above use case) for there to be a set_mutex
>>>>> the condition to change the facade, since both facades are
>>>>> simultaneously in use.
>>>> Yes, I've realized that too late. My set_mutex() function is
>>>> because it has to be atomic with the wait().
>>> I've just thought that it might be not so useless after all.
>>> is supposed to be called after the mutex was locked, and before
>>> condition::wait. Because the mutex is locked, we are protected
>>> simultaneous use. There can be a problem when multiple readers lock
>>> read, and simultaneously call set_mutex, but if we assume they all
>>> the same mutex it shouldn't be a problem.
>> How would wake from wait be handled? I.e. what mutex (facade) would
>> it use to lock with? The last one set may not correspond to the
>> proper one on wake.
> It would lock the same mutex it unlocked upon entering wait().
Could you prototype or sketch this out? Sorry, I'm not following.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk