[Stackless] Thought it is easy to right tasks continually waiting for messages

Andrew Francis andrewfr_ice at yahoo.com
Sun Jan 3 00:20:53 CET 2010


Hi Touman:

> Message: 1
> Date: Sat, 2 Jan 2010 10:35:30 +0000 (GMT)
> From: TOUMAN <touman at btinternet.com>
> To: stackless at stackless.com
> Subject: [Stackless] Thought it is easy to right tasks
> continually
>     waiting    for messages
> Message-ID: <135151.2221.qm at web87111.mail.ird.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 

> I want to create three tasks which are continually waiting
> for messages and don not die until they recieve the "exit"
> message. I have written the code below:

Offhand, from looking at your code, your problem is that after the 
main tasklet does unit_B.send(msg), all your other tasklets are blocked
on a receive(). Once your main tasklet ends, the programme terminates
because no tasklets are running.

Your main tasklet needs to do a bit more work pumping values to the 
tasklets.

Cheers,
Andrew    





      




More information about the Stackless mailing list