I have a Linux program which spawns several processes (fork) and communicates through POSIX Shared Memory. I\'d like to have each process allocate an id (0-255). My intentio
C++11 threading primitives (mutexes, atomics, etc) are threading primitives. They know nothing about processes, and they are not a means of achieving inter-process communication.
As the C++11 standard makes no mention of processes or inter-process communication, the behavior of such primitives when placed in process-shared memory (a memory-mapped file, some kind of out-of-process globally mapped memory, etc) is undefined.