[Stackless] question on preemtive scheduling semantics

Mads Darø Kristensen madsdk at gmail.com
Thu Mar 19 10:49:50 CET 2009


Paul Sijben wrote:
> Hi Mads,
>
> thanks for the quick reply!
>
> My app uses both thread and and tasklets. So should I do this once for
> the entire app (like I do now with just stackless.run()) or once for
> each thread in my app?

As far as I remember stackless keeps a runqueue (of tasklets) for each 
thread, so you need to have a stackless.run() invokation for each 
thread. A tasklet will then belong to the runqueue on the thread on 
which it was scheduled... I think.

I have built an execution environment using stackless, and in it I spawn 
a thread per CPU core so as to utilize the CPU properly. When I then 
schedule tasklets I alternate between inserting the tasklet from the 
different threads. This seems to work for me, i.e., I get 100% CPU 
utilization when executing multiple tasklets.

Best regards
Mads




More information about the Stackless mailing list