Thread (3 messages) 3 messages, 2 authors, 2006-08-29

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 RESERVATION
quoted
                     ......
                     lwarx
                     stwcx
// RESERVATION cleared
quoted
                     .....
                     .....
                     lwarx
// Get RESERVATION again
Now we do a task switch involving atomic operations, and thus an
reservation on another address.
This makes sense for me.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help