[Stackless] Beginner
olsongt at verizon.net
olsongt at verizon.net
Tue May 30 16:45:17 CEST 2006
> while 1:
> print "Before theTasklet.run()"
> theTasklet.run()
> print "After theTasklet.run()"
> ------
>
>
> Now, when I call run() on t1 I get the sequence > A1/A2/A1/A2... is there
> any other (possibly better) way to do it?
> Cristiano
In general, I think you're better off calling stackless.run() to kick off the tasklets. That line pretty much replaces the whole loop from above (but in this case will cause an infinite loop).
Other than that, you probably also only want to create tasklets when you want them to run. I don't think there's any advantage to creating them ahead of time and manually manipulating the scheduling via remove(). Let stackless do the work for you. So if you want to run A1... A2... over and over, just keep it simple and do:
stackless.tasklet(taskPrint)("A")
stackless.run()
_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list