Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiting on an Event on multiple threads is not reliable #11

Open
jleben opened this issue Apr 5, 2018 · 0 comments
Open

Waiting on an Event on multiple threads is not reliable #11

jleben opened this issue Apr 5, 2018 · 0 comments
Labels

Comments

@jleben
Copy link
Owner

jleben commented Apr 5, 2018

If nothing else affects the fd, then a poll on a single fd on multiple threads would wake up all the threads when the fd is written to. However, if one of the threads wakes up and reads the fd before another wakes up, then that other one will not wake up, because the fd has turned from readable to unreadable.

The only potential solution that I see at the moment is using the edge-triggered mode of epoll. We are using poll in wait though, in contrast with Event_Reactor.

Alternatively, we could disallow using an Event on multiple threads.

@jleben jleben added the bug label Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant