Is kqueue kevent() function threadsafe?

108 views Asked by At

Are calls to kqueue kevent() function safe to be used from multiple threads?

Let's say that I have 2 threads that have access to the same kqueue fd. Thread A which reads all kqueue events, and Thread B which uses EVFILT_USER and NOTE_TRIGGER to inform about unique events. Thread A also listens to sockets. My question is, since both Thread A and Thread B use kevent with the same kqueue fd for the above purposes, is there a need for mutex or is kevent threadsafe?

I hope someone can confirm that to me please

I'm using C on Mac

0

There are 0 answers