home blog portfolio Ian Fisher

Inter-process synchronization methods

You want to synchronize the execution of a parent and child process on Linux, so that the parent waits for the child to do step 1, then the child waits for the parent to do step 2, and so on. How do you do it?

(Motivating example: The test program I wrote for "POSIX semaphores do not auto-release on exit")

I find eventfd the cleanest, but (unlike pipes and socketpair) it can't detect when the other process has exited abnormally.