The discussion in http://software.intel.com/en-us/forums//topic/58670raises the point that TBB's atomic operations are lacking:
- A way to express an unfenced atomic load
- A way to express a full fence (i.e. fence with both acquire and release semantics)
(2) can be expressed pathetically as atomic::fetch_and_add(0).
I'm wondering about opinions on syntax and generality for the additions suggested above. The simplest approach would be to add:
- T atomic::unfenced_load() const
- void atomic::fence() const
Another approach would be to add T atomic::load() const, and allow M to specify acquire, release, full fence, or unfenced. But my opinion is that drags inmuch pointless complexity, because it adds "full_fence" and "unfenced" to the possibilities for M that is a template parameter for other atomic ops too, and the "release" variant for a load seems of dubious value.
Would the "simplest approach" be enough?