diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-06-21 00:56:05 +0200 |
---|---|---|
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-06-21 00:56:05 +0200 |
commit | 52ca84907b8048f6f81026ad9956793bf594519d (patch) | |
tree | 71c6b31796c0ce60fd3a14b78834a8f02b1edf3d /contrib/examples/nat-hole-punching/nat-punch-client.c | |
parent | mpmc_ptr_ring: add {,un}likely() annotations (diff) | |
download | wireguard-monolithic-historical-52ca84907b8048f6f81026ad9956793bf594519d.tar.xz wireguard-monolithic-historical-52ca84907b8048f6f81026ad9956793bf594519d.zip |
[BROKEN] mpmc_ptr_ring: Rely on null pointers to avoid p_tailjn/mpmc-null
This should fix a performance problem when two (or more) producers run
on the same CPU.
[ TODO: more text ]
previously:
Thread A Thread B
producer_head=1
write item
<preemptive context switch>
producer_head=2
write item
<stalled because producer_tail
is still 0>
<preemptive context switch>
producer_tail=1
producer_head=3
write item
<stalled because producer_tail is still 1>
...
with this patch:
Thread A Thread B
producer_head=1
write item
<preemptive context switch>
producer_head=2
write item
producer_head=3
write item
producer_head=4
write item
producer_head=5
write item
<preemptive context switch>
producer_head=6
write item
producer_head=7
write item
...
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions