upump-ev: use ev_async to notify remote event loop#1163
Closed
quarium wants to merge 1 commit intoUpipe:masterfrom
Closed
upump-ev: use ev_async to notify remote event loop#1163quarium wants to merge 1 commit intoUpipe:masterfrom
quarium wants to merge 1 commit intoUpipe:masterfrom
Conversation
0082f1a to
ac00e16
Compare
Use ev_async to notify remote event loop when an event is started from another loop. From man ev: ev_set_loop_release_cb [...] While event loop modifications are allowed between invocations of "release" and "acquire" (that's their only purpose after all), no modifications done will affect the event loop, i.e. adding watchers will have no effect on the set of file descriptors being watched, or the time waited. Use an "ev_async" watcher to wake up "ev_run" when you want it to take note of any changes you made. [...] Calling a control command on a worker pipe may freeze the remote pipe thread and forward the control command to it (for instance when calling upipe_set_uri on a worker wrapping a source pipe). This control command may need to add an upump in the remote event loop (for instance an idler for initialization). If so, when thawing the remote pipe, the remote event loop do not take account for this upump and the upump callback will not be triggered when needed. Using ev_async will force the remote event loop to wake up and take account for this new upump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use ev_async to notify remote event loop when an event is started from another loop.
From man ev:
ev_set_loop_release_cb
[...]
While event loop modifications are allowed between invocations of
"release" and "acquire" (that's their only purpose after all), no
modifications done will affect the event loop, i.e. adding watchers
will have no effect on the set of file descriptors being watched, or
the time waited. Use an "ev_async" watcher to wake up "ev_run" when you
want it to take note of any changes you made.
[...]
Calling a control command on a worker pipe may freeze the remote pipe
thread and forward the control command to it (for instance when calling
upipe_set_uri on a worker wrapping a source pipe).
This control command may need to add an upump in the remote event loop
(for instance an idler for initialization).
If so, when thawing the remote pipe, the remote event loop do not take
account for this upump and the upump callback will not be triggered when
needed.
Using ev_async will force the remote event loop to wake up and take
account for this new upump.