[Stackless] Scheduling Examples, Problems, Solutions, and Questions

Ásgeir Bjarni Ingvarsson istari at hlekkir.com
Wed Dec 14 13:55:51 CET 2005

The reason your channel sample stops is because:
     1. E is waiting for C -> goto 2
     2. C is waiting for B -> goto 3
     3. B is waiting for E -> goto 1
You become sensitive to the order in which the joins are made.


Queue.put only blocks if there is someone waiting on the channel.
Queue.get only blocks if there is no data waiting.

B will send "simultaneously" to C and E.
     Since E has not called get on the BtoE queue
     and C has not called get on the BtoC queue.
     This means B is free to push it's data without blocking.
E is waiting for C so it will not resume.
     E has called get on the CtoE queue and is blocked in recieve
C resumes and when it finishes it sends to D and E.
E has been waiting for C so now it's recieve on the C channel returns
     There is already data on the BtoE queue so it does not have to

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list