[Stackless] Newbie question
Christian Tismer
tismer at stackless.com
Sun Sep 21 19:31:42 CEST 2008
Richard Tew wrote:
> On Wed, Sep 3, 2008 at 4:08 PM, Jay Shaffstall <jshaffstall at gmail.com> wrote:
>> I'd thought that each tasklet would run once, round robin style, with
>> all others getting run once before the first ran again. A tasklet
>> that tried to receive on an empty channel would block, and when
>> another tasklet sent to that channel the first would unblock and go
>> back into the round robin queue.
>>
>> Am I misunderstanding how stackless works? Because what I think I'm
>> seeing is that the receiving tasklet runs immediately. I don't have
>> any call to stackless.run, but as soon as I call send on a channel,
>> the receiving tasklet runs, rather than having the send queue up until
>> the tasklet is next up to run.
>
> This behaviour is defined by the 'preference' attribute of the channel:
>
>>>> help(stackless.channel.preference)
> Help on getset descriptor __builtin__.channel.preference:
>
> preference
> -1 prefer receiver (default), 1 prefer sender, 0 don't
> prefer anything. See also schedule_all
>
> You probably want to set it to 1 for your channel.
FWIW, my guess is that he wants the 0 preference, just adding
the receiver to the round robin list.
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