httplib, threading, wx app freezing after 4 hours
Mark rainess
msrainess at comcast.net
Sun Jul 23 09:37:30 EDT 2006
bryanjugglercryptographer at yahoo.com wrote:
> Mark rainess wrote:
> [...]
>> It runs perfectly for about 4 hours, then freezes.
>> I'm stuck. How do I debug this?
> [...]
>> Can anyone suggest techniques to help me learn what is going on.
>
> By inspection: "errcode" is undefined; I expect you stripped the
> example
> a bit too far. If it is set to something other 200, it looks like you
> loop out.
>
> You are calling wx.CallAfter() from a different thread than runs the
> GUI.
> Is that documented to be safe? I've read that wxPostEvent() is is the
> call to
> use for this.
>
> Next thing to try is adding enough logging to tell exactly what
> statement
> hangs.
>
>
Thanks guys, I found the problem.
I had screen-saver set to None and power set to blank monitor after 30
minutes. The problem occurred after the monitor blanked. I remembered I
re-flashed my bios a few weeks ago. I didn't check the bios
power-management settings. I'm not going to reboot now to check because
I have too much stuff open.
I set power to never blank monitor. Now there is no problem.
I added code to monitor for activity and to kill and restart the thread
if activity stops. Now if power-management kills it, it wakes-up when
the screen returns.
I think using wx.CallAfter() the way I have is correct. I will check
that. It does work properly though.
Mark
More information about the Python-list
mailing list