-
Notifications
You must be signed in to change notification settings - Fork 1.2k
EventsLoopProxy does not wakeup the EventsLoop unless it's already blocked #266
Copy link
Copy link
Closed
Labels
C - waiting on authorWaiting for a response or another PRWaiting for a response or another PRD - hardLikely harder than most tasks hereLikely harder than most tasks hereP - highVital to haveVital to haveS - apiDesign and usabilityDesign and usability
Milestone
Description
See the conrod issue for a discussion on this:
To get a non-polling multi-threaded app running the conrod examples do the following:
- Create a rendering thread that reads inputs and writes it's output to a set of
std::sync::mpscchannels - Block the main loop on
EventsLoop::run_forever() - In the rendering thread whenever we have written the output use an
EventsLoopProxy::wakeup()to wake up the main thread - Inside
run_forever()pass on events to the channel until we get anAwakened - 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C - waiting on authorWaiting for a response or another PRWaiting for a response or another PRD - hardLikely harder than most tasks hereLikely harder than most tasks hereP - highVital to haveVital to haveS - apiDesign and usabilityDesign and usability