[Stackless] Interthread channel bug

Christian Tismer tismer at stackless.com
Tue Jan 15 06:18:27 CET 2008

Hi again,
I had a closer look and things are clear now.

Christian Tismer wrote:

>> 3. channelobject.c:generic_channel_action() is reached.  And the
>> following code is invoked.  This places the awokened tasklet in the
>> scheduler of the thread it belongs to.
>> 		if (interthread) {
>> 			/* interthread, always keep target! */
>> 			slp_current_insert(target);
>> 		}

This insert must in fact go away.
I just verified that this is correct to do.
The insert will be done from alone in slp_schedule_task,
which will be called with appropriate locking through


> Avoiding the insert fixes the crash, while it does not give the
> expected behavior (prioritizing the target tasklet).
> I'm not sure if this is really needed, but it is somewhat annoying
> that this cannot be controlled.

Wrong. It is intended behavior not to do anything about tasklet
reordering for interthread actions.

Please apply your patch, it is exactly how it should be.
It would be nice if you would add a comment to channelobject.c:427
that says that target will implicitly inserted at the right time
when interthread locking is in place.

Thanks a lot for solving this problem.

cheers - 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/

More information about the Stackless mailing list