[Stackless] Explicit yield/break to Preemptive Stackless Loop

Christian Tismer tismer at stackless.com
Thu Nov 9 13:04:01 CET 2006


Richard Tew wrote:
> On 11/4/06, Brian Hardie <bhardie at cs.usfca.edu> wrote:
>> schedule_task_block(PyTaskletObject *prev, int stackless)
>> {
>>     ...
>>     if (check_for_deadlock()) {
>>        /*revive real main if floating */
>>        if (ts == slp_initial_tstate && ts->st.main->next == NULL) {
>>           /* emulate old revive main behavior:
>>            * passing a value only if it is an exception
>> ...
>>
>> I think the expression 'ts == slp_initial_tstate' is checking to see if
>> we are running within the main thread.  If so, it recovers the main
>> tasklet.  My tasklets are not run by the main thread; perhaps this has
>> been a problem.
> 
> What say you, Jeff and Christian?  There is no reason we shouldn't just
> remove this slp_initial_tstate check, right?

No, I'm missing some convincing consideration why this
is right. We need a concept how multiple execution
chains in multiple threads are supposed to play together,
or if we better want to avoid this and allow for single,
thread-based tasklets only, for instance.

I have no clue, yet where this should go and need more input.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/

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



More information about the Stackless mailing list