[Stackless] Re: return values from tasklets
Kristján V. Jónsson
kristjan at ccpgames.com
Thu Jan 29 10:36:51 CET 2004
Just my 2 pfennig:
I think the idea of having tasklet.run() return a value to the caller is misguided. This is what direct function calls are for. After all, if the calling tasklet schedules the callee to run, then sits and waits for it to return, what´s the difference? Now, some threading models like pthreads have wait() semantics. This should be easy enough to implement in stackless with a channel in the tasklet object. Alternatively, roll your own.
What you want is:
mytasklet = tasklet.new(foo)
mytasklet.letloose() #or whatever. somehow trigger it to be run, or not, depending.
a = myownstufftodo.doit()
b = thatotherresult = mytasklet.wait()
From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of Christian Tismer
Sent: 29. janúar 2004 00:43
To: Arman Bostani
Cc: stackless at stackless.com
Subject: [Stackless] Re: return values from tasklets
Then I'd really need a definition of what run() should do.
Does it mean that that tasklet should run now? (Current truth)
Or, should it mean that that tasklet should run and return it's
value to the current caller, which is the tasklet that issued
the run() command? Guaranteed?
Other question: Would such behavior, provided it makes sense,
contradict the CSP paradigms?
Stackless mailing list
Stackless at stackless.com
More information about the Stackless