Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

atomic<T> memory semantics

lib_team
Beginner
119 Views
Hi,

I've been through a few threads on the tbb forum that talk about atomic and the lack ofunfenced/relaxed memomy semantic, but I didn't managed tounderstand the reasons of that choice.
Can someone explain? Isn't unfenced semantic usefull (when the processor supports it at least)?

Regards
0 Kudos
2 Replies
RafSchietekat
Black Belt
119 Views
x86 doesn't...
Dmitry_Vyukov
Valued Contributor I
119 Views
Relaxed atomics are definitely useful. The usage that justifies them single-handed is atomic reference counting.
My guess as to why TBB does not feature relaxed atomics is that, well, it's heavily rooted in x86 systems regardless of declared portability. Another possible reason is that AFAICT TBB is never declare atomics as a first-class user API.

Reply