threads problem in python

castironpi at gmail.com castironpi at gmail.com
Tue May 13 09:29:52 EDT 2008


On May 13, 5:38 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Tue, 13 May 2008 06:42:13 -0300, Astan Chee <st... at al.com.au> escribió:
>
> > I have 2 classes in python, the first one runs first and and then the  
> > first one calls the second class. I want it to run the second class as a  
> > separate thread but I want the first one to wait until the second class  
> > is dead.
> > Im having problem in both killing the second class when its done and  
> > making the first class wait for it to finish.
> > Im very confused on doing threads in python.
>
> I'm confused trying to understand your requirements too. "run a class?"
> Threads execute code, it's easier to think of them as *functions* that are  
> executed at the same time (or almost).
> So you have a function A that runs first, and creates a second thread that  
> will execute function B. Then A will wait for B to finish. What do you  
> want to do in A while it's waiting? Nothing? Then why to use a second  
> thread? Or is it a graphical interfase? GUI libraries like wxPython, Qt  
> and others have specific ways to execute backgroung tasks while keeping  
> the user interface responsive - you should tell us which one you're using  
> in that case.
>
> --
> Gabriel Genellina

I don't mean to be impertinent, but are you making any cents with the
assignment?  Both free-ers and workers come in here.  I am a free-er
who has reason to doubt that money-driven programs get stuck at that
kind of ambiguity.  I hold that money keeps you out of that mess.

However, there are a number of things we can do to help, but as I, per
se, am only one person, I may not give you the best advice to start
with.  How do you find the 'threading.py' docs?



More information about the Python-list mailing list