[parisc-linux] atomic_t

Grant Grundler grundler@dsl2.external.hp.com
Mon, 14 Jan 2002 00:12:32 -0700


Matthew Wilcox wrote:
> Not on PA... look at <asm/atomic.h>.  There's only 3 primitives, all
> other atomic ops are defined in terms of those.

Ah ok - you are right. atomic_read() doesn't use the lock and
that only leaves the other two.

> > But someone thought it was time to reset the counter. And if
> > it "never happened", then whoever is looking for 'v == 1' will
> > never see it.
> 
> It's a race though; they can't guarantee to see it anyway.

hmmm...Most people write code with the intent of seeing *some*
event (eg v < 0).  Ie, if it didn't matter, then we don't need
the code.  I'd like to believe folks are usually more careful
than that.  I need to think about this some more though.

grant