On Fri, 23 May 2003, Davide Libenzi wrote: > You need a write memory barrier even on the unlock. Consider this : > > spinlock = 1; > ... > protected_resource = NEWVAL; > spinlock = 0; > > ( where spinlock = 0/1 strip down, but do not lose the concept, the lock > operation ). If a CPU reorder those writes, another CPU might see the lock > drop before the protected resource assignment. And this is usually bad > for obvious reasons. David made me notice about a brain misfire here. You need protection even for loads crossing the unlock. For the same obvious reasons :) Yes, a realease barrier will be sufficent for ia64, while you'll need an mfence on P4. - DavideReceived on Sat May 24 07:43:45 2003
This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:15 EST