I am interested in using a semaphore created using semaphore_create(task, sem, policy, value) from mach/semaphore.h in shared memory to synchronize two processes on Mac OS.
I know that on Linux using sem_init(sem, pshared, value) , pshared should be non-zero in this case, however I cannot find information on Mac (where sem_init not implemented), and I really don't want to use the named semaphores since I will need to create a lot of them.
I experimented with a minimal example and it doesn't seem to work, so I wonder if I did something wrong or just doesn't work. I am also open to other alternatives between processes.
source share