eventfd is thread safe according to the man pages ATTRIBUTES section
ATTRIBUTES top
For an explanation of the terms used in this section, see
attributes(7).┌──────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├──────────┼───────────────┼─────────┤ │eventfd() │ Thread safety │ MT-Safe │
I want to wrap eventfd with boost::asio::posix::stream_descriptor so I will be able to use it in boost::asio::io_service.
According to boost stream_descriptor reference, stream_descriptor isn't thread safe
Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.
So if I understand correctly it's not safe to read / write using boost::asio's async_read_some / write_some with multiple threads from / to an eventfd wrapped with stream_descriptor.
Which is kind of a "downgrade", because native eventfd allows it.
Is my understanding correct?