[parisc-linux] Re: [parisc-linux-cvs] linux grundler

Randolph Chung Randolph Chung <tausq@debian.org>
Sat, 8 Feb 2003 16:49:42 -0800


> I think the volatile provides the barrier in my suggested version.

volatile would prevent reordering accesses to a particular spinlock, 
but does it ensure that code that happens after the spinlock will not
be reordered to happen before the spin-unlock?

for example, if we had:

volatile spinlock l1, l2;

lock(l1)
do something
unlock(l1)

lock(l2)
do something else
unlock(l2)

will gcc ever move the lock(l2) before the unlock(l1)? 

(for reference, see this thread:
http://lists.debian.org/debian-gcc/2002/debian-gcc-200210/msg00058.html)

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/