Re: Is clobber "memory" in include/asm-i386/system.h necessary?

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 6 May 1996 21:06:26 +0100 (BST)


> What about MP machines? Wouldn't volatile still be needed between a
> cli() and sti() because other processors might change the value out
> from under you? Granted, a higher level of locking would prevent
> that, but there are cases where you might want that to happen (like in
> the lock manager code, assuming it uses atomic memory access
> instructions).

volatile isnt enough for portable SMP code. While the intel boards
have coherent memory caches and strong store ordering the sparcs dont all
posess this nor do many other processors. Thus a write to a volatile variable
might not be seen on the other processor at once.

Alan