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
Rather than the current threading approach, which will require careful thought when any change is made to the timeout code, we can move to a more explicit approach:
Process.waitpid2 and Timeout.timeout can each run in a thread - rather than the current blocking wait, we'll use Process::WNOHANG and sleep-loop, checking a queue and then trying a wait every quarter-second. When the timeout goes off, it'll go off in a thread, and push a :timeout onto the queue. This approach prevents either thread from interrupting the other, and makes adding complexity to the timeout code (as in #3) much more reasonable.
Rather than the current threading approach, which will require careful thought when any change is made to the timeout code, we can move to a more explicit approach:
Process.waitpid2
andTimeout.timeout
can each run in a thread - rather than the current blocking wait, we'll useProcess::WNOHANG
and sleep-loop, checking a queue and then trying a wait every quarter-second. When the timeout goes off, it'll go off in a thread, and push a:timeout
onto the queue. This approach prevents either thread from interrupting the other, and makes adding complexity to the timeout code (as in #3) much more reasonable.Suggestion from moomaka here.
The text was updated successfully, but these errors were encountered: