1. It seems that you intentionally do not want the add32, sub32,
and inc32 return a value.  Only the dec32 function returns a
value, and that value can only be used as a boolean (zero or
nonzero).

2. There is no atomic exchange function that atomically sets
the new value and returns the old value.  (This can be implemented
with the cas32 function in your API, so people can work around the
lack of the atomic exchange function.)

3. Providing cas32 is risky.  It tempts people to build lock-free
data structures with it, but the necessary memory barriers are
difficult to use right, and few people even realize that memory
barriers are necessary on some multiprocessor systems.

Wan-Teh



Reply via email to