Skip to content

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

Description

@jleben

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions