[Tutor] threads

Shitiz Bansal shitizb at yahoo.com
Fri Feb 25 13:33:32 EST 2005


> >Can anyone guide me on how to spawn
> >simultaneously( or
> > pseudo simultaneously) running microthreads using
> > stackless.
> > 
> > Here is what i tried..
> > 
> > def gencars(num,origin,dest,speed):
> >     global adjls
> >     global cars
> >     global juncls
> >     for i in range(num):
> > 
> >              cars.append(car(orig,dest,speed)
> >              task=tasklet(cars[i].run())
> >              task.setup('Bind using Setup')
> > 
> > Now this is what i copied from somewhere...i dont
> > claim to understand fully what is happening.Here
> > car.run() is a process which takes a long time to
> > execute.
> > 
> > What happens on execution is....One car is
> >initialised
> > and then the program waits for its run method to
> > complete before proceeding.
> > 
> >How is it different from :
> > for i in cars:
       i.run()



> > I also feel that there is no clear documentation
> > on
> > stackless.
> > 
> > Show me the light.
> > 


		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 



More information about the Python-list mailing list