I’m looking for the lowest latency IPC that allow to put one process to sleep and allow other process to wake it.
I’m looking for the lowest latency method. Some possible methods so far:
- Writing a byte to a pipe and reading it from it.
- Writing a byte to a socket and reading it from it.
- Sending a signal (kill) and waiting for it (sigwait)
- Using sem_post/sem_wait
Any other better ideas?
Any solution that is Linux specific is fine as well.
Generally… There is almost no difference between the OS methods.
Setup:
and then notifies other process.
Results:
Semaphore (sem_wait/sem_post – kernel – futex):
Signal (kill/sigwait)
Pipe (pipe + write/read)
Socket (socketpair +write/read)
As a reference busy waiting: