Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout and waitpid should be in side-threads #7

Open
nevinera opened this issue Jul 5, 2015 · 0 comments
Open

Timeout and waitpid should be in side-threads #7

nevinera opened this issue Jul 5, 2015 · 0 comments

Comments

@nevinera
Copy link
Contributor

nevinera commented Jul 5, 2015

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.

Suggestion from moomaka here.

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

No branches or pull requests

1 participant