583d6fdae0 | ||
---|---|---|
.. | ||
ev_builder.out | ||
event_builder_epoll.cxx | ||
exec_order_test.sh | ||
prov.out | ||
provider.cxx | ||
readme.md | ||
res.txt |
readme.md
Is epoll really thread safe?
Motivation
Scope of this test is simply to verify that TCP communication with epoll doesen't mix data. In particular, it's important to verify that if one big chunk is sent, the TCP protocol doesen't split it into different events for level triggered epoll (ofc it's gonna be splitted due to buf size).
The important thing is that if I send 1MB of data, it doesen't wake up 2 threads listening to the same fd just because TCP split the package (afaik that shouln't happen, but it's always better to verify, since epoll()
is fundamentally broken).
Tested on sending buffer of size 1000 (receiving size 8 2 threads) with simulation re-executed 1000 times -> no reordering. This approach should then be considered safe and used in the project.