Re: atomic operations in user space
From: Li Yang <hidden>
Date: 2006-08-29 17:00:37
On 8/30/06, Esben Nielsen [off-list ref] wrote:
On Tue, 29 Aug 2006, Li Yang wrote:quoted
quoted
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, retry.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.quoted
Task A Task B lwarx// Get RESERVATIONquoted
...... lwarx stwcx// RESERVATION clearedquoted
..... ..... lwarx// Get RESERVATION againNow we do a task switch involving atomic operations, and thus an reservation on another address.
This makes sense for me.