niligulmohar/python-symmetric-jsonrpc — Issue #9: Remove poll() timeouts
Author: smurfix
Created: 2012-02-10 10:50:49+00:00
State: open

Busy-waiting in a 100ms delay loop for a parent to MAYBE signal that your thread should exit is ugly and doesn't work at all on platforms which have to use multiprocessing instead of native threads.

The best way to do this is to also wait on a pipe. Let the parent write a byte to the pipe if it wants its children to exit; let the child thread exit if the pipe's read side is ready.