Skip to content

EventsLoopProxy does not wakeup the EventsLoop unless it's already blocked #266

@pedrocr

Description

@pedrocr

See the conrod issue for a discussion on this:

PistonDevelopers/conrod#1051

To get a non-polling multi-threaded app running the conrod examples do the following:

  1. Create a rendering thread that reads inputs and writes it's output to a set of std::sync::mpsc channels
  2. Block the main loop on EventsLoop::run_forever()
  3. In the rendering thread whenever we have written the output use an EventsLoopProxy::wakeup() to wake up the main thread
  4. Inside run_forever() pass on events to the channel until we get an Awakened
  5. Finish the main loop by rendering from the second channel and go back to blocking in run_forever()

The problem with this setup is that step 3 doesn't reliably unblock run_forever() because if you use EventsLoopProxy::wakeup() when not inside run_forever() the next time run_forever() runs it will not immediately unblock.

Is this intended behavior? @mitchmindtree was expecting the semantics of wakeup() to be that if it's called it will unblock run_forever() immediately when it gets called and that does sound much more useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C - waiting on authorWaiting for a response or another PRD - hardLikely harder than most tasks hereP - highVital to haveS - apiDesign and usability

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions