atomic operations in user space
nielsen.esben at gogglemail.com
Wed Aug 30 02:05:43 EST 2006
On Tue, 29 Aug 2006, Li Yang wrote:
>> This is exactly how it is supposed to work! That's why there is a loop
>> in the atomic increment - you check if you still had the reservation
>> after the transaction by checking the result from the stwcx, and if not,
> I surely know all the theories you mentioned clearly. But please do
> look at the case I gave. Correct me if I missed anything. Thanks
> All the lwarx and stwcx operate on the same address.
>> Task A Task B
> // Get RESERVATION
> // RESERVATION cleared
> // Get RESERVATION again
Now we do a task switch involving atomic operations, and thus an
reservation on another address.
> //Note here: RESERVATION is valid, address is the same.
> So the result is commited, no retry for task A
> //RESERVATION is cleared, retry atomic op for task B
> Please be noted that reservation is only identified by reservation bit
> and address operated on. So different lwarx's on the same address,
> may be considered as the same reservation.
> Linuxppc-embedded mailing list
> Linuxppc-embedded at ozlabs.org
More information about the Linuxppc-embedded