python, offlineimap and wakeups (outch)
glasse at cs.rpi.edu
Wed Mar 9 18:14:45 GMT 2011
On 03/09/2011 06:39 AM, Sebastian Spaeth wrote:
> Some research revealed the a thread.join() will wake up often too see if
> our threads are still alive. And true, invoking offlineimap with the -1
> option makes the wakeups go down from 20 to 0.1 per second!
Can you elaborate? Attached please see a simple program that doesn't
seem to trigger wakeups at all (no output from "sudo powertop -d | grep
I do see code in the threading.Condition.wait() method, which
sleeps/busy waits until it gets notified, with a comment that "if we
sleep the whole timeout time, we'll be unresponsive". But that only
happens if we join() with a timeout, and as far as I can tell, we don't
provide a timeout on any join() calls in offlineimap.
Anyhow, that comment raises the question: Responsive to what?
KeyboardInterrupt? You can try with the attached program, thread.join()
doesn't respond to KeyboardInterrupt either. If it really is
Thread.join, maybe we can subclass threading.Thread and define join in a
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 444 bytes
Desc: not available
More information about the OfflineIMAP-project