tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Another atomic op
I'd like to add another atomic op to do compare-and-swap that is only
'locally atomic'. That is to say, it would only be atomic in respect of
preemption or interrupts on the running CPU. MP-atomic operations are slow
especially when there is cache traffic involved. It's a bit of a corner case
so I'd only like CAS - everything else can be built on that by hand.
The _ni suffix implies "non interlocked". If not explicitly provided or
needed on a particular platform (UP only for example) it could be aliased
to the regular atomic_cas functions.
foo_t atomic_cas_foo_ni(volatile foo_t *, foo_t, foo_t);
Comments?
Thanks,
Andrew
Home |
Main Index |
Thread Index |
Old Index