tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: __{read,write}_once



On Sat, Nov 16, 2019 at 03:56:35PM +0000, Mindaugas Rasiukevicius wrote:
 > > > I suggest __atomic_load_relaxed()/__atomic_store_relaxed().
 > > 
 > > What I don't like with "atomic" in the name is that the instructions
 > > generated are not atomic strictly speaking, and I'd rather avoid the
 > > confusion with the really atomic instructions.
 > 
 > I see the potential source of confusion, but just think about: what could
 > "atomic" possibly mean for loads or stores?  A load is just a load, there
 > is no RMW cycle, conceptually; inter-locking the operation does not make
 > sense.  For anybody who attempts to reason about this, it should not be
 > too confusing, plus there are man pages.

...that it's not torn.

As far as names... there are increasingly many slightly different
types of atomic and semiatomic operations.

I think it would be helpful if someone came up with a comprehensive
naming scheme for all of them (including ones we don't currently have
that we're moderately likely to end up with later...)

Ordinarily I would go do this but I am completely swamped :-(


For the moment, I don't especially like *_relaxed as "relaxed" is
normally an ordering property, and while ordering and atomicity are
different things, they're not really separable in the naming scheme.

I might suggest "localatomic". Or maybe just "untorn", but that looks
weird.

however _relaxed is far better than *_once which is really confusing :(

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index