Better solution for Python Threading.Event semi-busy waiting
问题 I'm using pretty standard Threading.Event: Main thread gets to a point where its in a loop that runs: event.wait(60) The other blocks on a request until a reply is available and then initiates a: event.set() I would expect the main thread to select for 40 seconds, but this is not the case. From the Python 2.7 source Lib/threading.py: # Balancing act: We can't afford a pure busy loop, so we # have to sleep; but if we sleep the whole timeout time, # we'll be unresponsive. The scheme here sleeps