Does POSIX specify a memory consistency model for its multithreading interface (semaphores and pthreads)? I'm not talking about atomic primitives, but a pseudo-formal specification for the visibility of side effects in the sense that C11 specifies happens before, synchronize with, inter-thread happens before, modification-order, visible side effect and so on (note that C11 uses these concepts not only for atomic primitives, but also for lock-based primitives such as mtx_lock
/mtx_unlock
and others that have an equivalent in POSIX).
Asked
Active
Viewed 29 times
1

Jonathan Leffler
- 730,956
- 141
- 904
- 1,278

Mario Robles
- 111
- 6
-
POSIX is memory model agnostic. POSIX calls are expected to behave correctly with respect to each other regardless of the memory model. – Variable Length Coder Jan 24 '15 at 00:18
-
1See also http://stackoverflow.com/questions/12772656/memory-model-spec-in-pthreads – nos Jan 24 '15 at 00:20
-
Note that POSIX 2008 of necessity refers to C99 rather than C11, so it doesn't have the verbiage associated with C11. – Jonathan Leffler Jan 24 '15 at 06:06