[Stackless] Re: return values from tasklets

Tom Locke tom at livelogix.com
Thu Jan 29 13:10:20 CET 2004


> What you want is:
> mytasklet = tasklet.new(foo)
> mytasklet.letloose() 
> a = myownstufftodo.doit()
> b = thatotherresult = mytasklet.wait()
> return a,b

Yep - this makes sense to me. wait() is sometimes called join(), as in
join two threads into one. I was looking for this in stackless a while
back.

I guess you'll need to store the return value somewhere, in case the
tasklet finishes before the call to wait(). Maybe this should be
visible, as in: 

> mytasklet = tasklet.new(foo)
> mytasklet.letloose() 
> a = myownstufftodo.doit()
> mytasklet.wait()
> return a,mytasklet.result

Just thinking outloud, er, well no, but... never mind.

Tom.



_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list