I have a chunk of shared memory containing some data. Reading / writing this data needs to be synchronized between different processes. At this moment I'm using unnamed POSIX semaphores. Since my main concern is speed, I'd like to know if semaphores are optimal here? Do they end with a syscall for example (userspace -> kernel space), or force context switches? What would you suggest?
Some info on unnamed semaphores: http://linux.die.net/man/3/sem_init