Starting a thread before wxPython bootup ... interesting.

david david at nospam.spam
Thu Oct 4 20:58:50 EDT 2007


Since the observed behaviour is clearly undefined,
I forgive you for the poorly specified behaviour
description: asking for a close description of random
behaviour is just ridiculous.

The most obvious point is that wx is not re-entrant
or thread safe: you have to make it so by using
wx.CallAfter()

Since you are talking about a bug in your screen
display while using a screen library, it would
also be interesting it you described the environment:
Which operating system? Which windowing system?
Which wx library? Which Python? Which IDE? What code?

[david]






Shafik wrote:
> Hello folks,
> 
> I'm having an issue with mixing wxPython and threading ... I realize
> multi-threading always introduces subtle bugs, but the following
> scenario is just odd:
> 
> I start a dummy thread, that does nothing but increment a counter and
> print its value to the screen, then afterwards, I start the wxPython
> application. I get nothing but weird behavior: sometimes the gui just
> crashes, sometimes I get an exception, sometimes it runs for a little
> but very slowly ...
> 
> Anyone know whats going on? I have a dual-core T5500, so multi
> threading is piece of cake for it hardware -wise.
> 
> 
> Cheers,
> --Shafik
> 



More information about the Python-list mailing list