Starting a thread before wxPython bootup ... interesting.

Shafik shafik23 at gmail.com
Fri Oct 5 13:36:10 EDT 2007


My apologies for not supplying more info, I am at work and I am
technically not allowed to surf the web for anything.

I am using Python 2.5.1,  the latest wx version (2.8.xx, I dont recall
exactly). This is running under windows XP under the latest version of
cygwin (that could be the source of the issues too).

I was just looking for a general way to approach wx and
multithreading, not a detailed solution to my problem. There are lots
of tutorials online that describe how to perform a time-consuming task
in a separate thread in a wx-gui, but nothing that describes any other
use cases.

The real goal is to start the gui in a different thread, and have the
main thread regain control. That seems like a feasible thing to be
able to do, though I have been unsuccessful ... if anyone would like
to suggest something without being covertly insulting, I'm all ears.


Thanks,
--Shafik

On Oct 4, 5:58 pm, "[david]" <da... at nospam.spam> wrote:
> 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