2 ms·
POSIX has had barriers since around 2000 or so: pthread_barrier_wait and friends. Memory barriers and POSIX-style barriers are semantically related; both mecha
by kazinator 6y ago
POSIX has had barriers since around 2000 or so: pthread_barrier_wait and friends.
Memory barriers and POSIX-style barriers are semantically related; both mechanisms ensure that certain events are not re-ordered between adjacent phases; they stay on their side of the barrier.
- gpderetta 6y agoYes; the C++ multithreading support owes a lot (among many influences) to pthreads and one reason that low level memory barriers were called fences was to reserve the barrier name to a possible pthread-like construct.
- kazinator 6y agoMemory barriers also being called fences ("fence instruction") long precedes C++ multithreading. (That conflicts with "fence register"; a concept in non-virtualized memory management whereby each running process is confined to accessing range of memory delimited by values held in fence registers.)