Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::shared_locks and boost::upgrade_locks
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-12-13 18:11:16


Le 08/12/11 18:30, Kelvin Chung a écrit :
> On 2011-12-08 16:58:00 +0000, Vicente Botet said:
>
>> In general unlocking a shared lock and lock a upgrade lock is not a good
>> idea as the read data on the shared lock scope can be changed by another
>> thread as soon as you release the lock and so you computation is not
>> coherent.
>
> My data is "single-assignment" style: once an Input/Output pair is
> written into the Cache it is never modified, so that isn't an issue
> for me as long as I re-read after getting the upgrade lock. However,
> wouldn't re-reading after getting the upgrade lock address this in
> general?
>
>
Yes, this is equivalent to re-trying the whole 'transaction'

Vicente


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