[Stackless] Blocking

Gijs Kunze gijs at vanillev.la
Tue Apr 26 13:19:54 CEST 2005


I recently rediscovered stackless, and I think that unlike the last time I
understand how it works (at least little bit). I've played around with
some small scripts but I need to know more about how to program some
larger-than-helloworld like programs.

As I understand it, unlike what happens with 'real' threads, tasklets
don't switch when doing a blocking operation (i/o, time.sleep), so in a
tasklet you can only do those types of tasks asynchronously unless you
want all tasklets to stop while completing said task. (please correct me
if I'm wrong). At first I thought you would have to make your tasklet
busy-wait, something like:

while not job_done():
    stackless.schedule()

However I thought of another way, have the tasklet remove itself (via
tasklet.capture) and have a seperate os-thread perform the job
synchronously and insert the tasklet when the job is done. However I'm not
sure this is possible, hence the following questions:

Does inserting a tasklet removed from thread A while in thread B insert it
in the scheduler list in A or in B?
Are there even seperate scheduler lists for each thread?

Thanks,

Gijs Kunze







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



More information about the Stackless mailing list