You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select: Enable timeout on select when PROXY_TO_PTHREAD
This commit enables the select syscall to handle timeout with multiple event
sources. PROXY_TO_PTHREAD is needed to prevent blocking the main worker.
When a thread worker invokes the select syscall with non-zero timeout and no
fd is ready, it blocks using Atmoics.wait until it receives a readiness
notification. On the main worker, the underlying stream implementation can
trigger readiness using Atomics.notify through a callback. A notification
also issued automatically once the specified timeout expires.
Communication between the thread worker and the main worker occurs via
shared memory regions. To prevent a select invocation being unblocked by the
callbacks of a previous invocation, all active callbacks are tracked in a
list. See the comments in activeSelectCallbacks for details.
Usage of the notification callback is optional. If the stream implementation
doesn't support it, the "poll" method can still synchronously return the
event status.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
0 commit comments