[parisc-linux] atomic_t

Alan Cox alan@lxorguk.ukuu.org.uk
Mon, 14 Jan 2002 09:54:44 +0000 (GMT)


> > exclusivity...  I thought we could eliminate it.
> 
> You are only looking at interactions between atomic_set
> and atomic_add_return. Aren't there potentialially other
> types of interactions with other atomic operations?
> But I don't know. Alan Cox?

We had a discussion about some of this on #kernel. Its not clear. The
x86 port "knows" that writes are going to be atomic. It means that

	CPU1			CPU2
value=4
	atomic_set=0		atomic_add +1

will result in an addition to the set value, or an addition then the
entire result discarded for the set value. It won't (except in obscure
hardware bug cases 8)) result in the set being lost during the add

ie you might see 0 after those operations, or you might see 1, but you
won't see 5 after both have completed.