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 laten
Using the same code provided by @Artyom, but in a more morden hardware.
CPU: i9-9900k, closing C/S/P-state and set scaling policy as performance which keeps cores running at the maximum frequency(~5GHz).
OS: Preempt-RT patched Linux with kernel5.0.21, providing better real-time performance.
CPU affinity: two processes apartly running in two isolated cores, which keep away from irrelevant processes and interrupts AMSP.
Results:
Semaphore (sem_wait/sem_post - kernel - futex):
sleep us mean minimum median %99
1 1.75 ±0.1 1.60 1.74 1.82
10 1.76 ±0.0 1.61 1.75 1.83
100 2.12 ±0.3 1.59 2.24 2.42
1000 2.46 ±0.3 1.75 2.47 2.56
10000 2.45 ±0.1 2.11 2.44 2.54
Signal (kill/sigwait)
sleep us mean minimum median %99
1 2.15 ±0.2 2.00 2.13 2.22
10 2.12 ±0.2 1.93 2.11 2.19
100 2.56 ±0.3 2.00 2.67 2.88
1000 2.90 ±0.3 2.17 2.90 3.01
10000 2.94 ±0.5 2.66 2.89 3.03
Pipe (pipe + write/read)
sleep us mean minimum median %99
1 2.05 ±0.2 1.88 2.03 2.15
10 2.06 ±0.3 1.89 2.04 2.17
100 2.54 ±0.4 1.88 2.63 2.87
1000 2.98 ±0.3 2.27 2.98 3.09
10000 2.98 ±0.3 2.69 2.96 3.07
Socket (socketpair +write/read)
sleep us mean minimum median %99
1 3.11 ±0.4 2.85 3.09 3.22
10 3.14 ±0.1 2.92 3.14 3.25
100 3.66 ±0.5 2.92 3.74 4.01
1000 4.03 ±0.4 3.28 4.03 4.17
10000 3.99 ±0.4 3.64 3.96 4.10
As a reference busy waiting:
sleep us mean minimum median %99
1 0.07 ±0.1 0.06 0.07 0.07
10 0.07 ±0.1 0.06 0.07 0.07
100 0.07 ±0.0 0.06 0.07 0.08
1000 0.09 ±0.1 0.07 0.08 0.09
10000 0.09 ±0.1 0.07 0.09 0.09