Skip to content

upipe_xfer: use ueventfd to suspend remote thread - #1227

Open
nto wants to merge 2 commits into
Upipe:masterfrom
nto:upipe-xfer-yield
Open

upipe_xfer: use ueventfd to suspend remote thread#1227
nto wants to merge 2 commits into
Upipe:masterfrom
nto:upipe-xfer-yield

Conversation

@nto

@nto nto commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Supersede #1218.

nto added 2 commits August 7, 2026 15:02
Also fix the fallback eventfd init which contained invalid code for
setting non-blocking mode.
Using a mutex for blocking a remote event loop may introduce unbounded
wait because pthread_mutex_unlock does not guarantee that another thread
waiting to acquire the lock will be scheduled right away.

Instead, use a pair of ueventfd for synchronization, and add a
UPIPE_XFER_YIELD message to ask the remote thread to suspend itself.

Moreover, mutex based exclusion was generally impossible to implement in
upump managers other than libev.
@nto
nto force-pushed the upipe-xfer-yield branch from fba486c to 42d9350 Compare August 7, 2026 13:44
@nto nto changed the title upipe_xfer: use eventfd to suspend remote thread upipe_xfer: use ueventfd to suspend remote thread Aug 7, 2026
@nto
nto requested a review from quarium August 7, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant