Threading and Windows.

Jorge Godoy godoy at metalab.unc.edu
Tue Sep 30 08:09:24 EDT 2003


tebeka at cs.bgu.ac.il (Miki Tebeka) writes:

> Hello Jorge,

Hi Miki.

>> I have a simple task where I want my GUI to be able to open several
>> applications simultaneously. Using the threading module everything
>> works perfectly on Linux but the program won't run on Windows.
> What do you mean by "won't run"? Does it crash? ...

No. It just hangs. I have to kill it. If it crashed I could try
investigating the reason but the reason of the hangup is a little
harder to find out.

>> Any hints on what should I do? 
>> The working code is really simple and is all what I need on both
>> platforms (pseudo-code follows):
>> [...]
> Just guessing:
> 1. The spawnl of a .py don't work. You need to start the python interpreter
>    on the .py file

This is what I found out using the 'thread' module. I'll change the
code so that it checks the OS and take the action based on that
answer, but it really annoyed me using threads there.

BTW, the 'threading' module didn't work whie the 'thread' did. I dunno
the inner details of implementation, but it might give a hint on the
problem... (Just guessing)

> 2. The GUI toolkit you're using is causing the problem. To check this try
>    lauch threads without any gui and see if it works.

I't worked with one example I found on the net while trying to find an
answer, but it hang with another. The one that hung was just making 4
threads and measuring the time each of them 'sleep()'ed and summing it
all on the main thread. It worked perfectly here (Linux), but not
there (Windows XP).

> HTH.
> Miki


Thanks Miki.

-- 
Godoy.     <godoy at metalab.unc.edu>




More information about the Python-list mailing list