httplib, threading, wx app freezing after 4 hours

Dermot Doran dppdoran at gmail.com
Thu Jul 27 05:23:03 EDT 2006


According to the "wxPython in Action" book using the wx.CallAfter function
in a non-gui thread is a safe way for threads to call functions that will
then update the gui in the gui thread.

Cheers!!

Dermot.


On 23/07/06, Mark rainess <msrainess at comcast.net> wrote:
>
> 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
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060727/affc0c4b/attachment.html>


More information about the Python-list mailing list