[Stackless] Figuring out stackless for use in Twisted
Christopher Armstrong
radix at twistedmatrix.com
Wed Jul 30 11:58:45 CEST 2003
On Wed, Jul 30, 2003 at 06:48:06AM +0200, Christian Tismer wrote:
> Christopher Armstrong wrote:
> >
> >Hrm... Does that mean that I might get context switches in arbitrary
> >points in my code, or only when "blocking" on a channel.send() or
> >channel.receive()? If the latter, I would call that "implicit
> >cooperative scheduling", not really pre-emptive. :-) I hope it's the
> >latter!
>
> Please refer to the docstrings of channel methods.
> (Hoping the info is in fact there :)
>
> If a tasklet is blocked in a channel, it is blocked.
>
> Scheduling, whether explicitly done (stackless.schedule())
> or implicitly, pre-emmptive (by a still-to-be implemented
> option to stackless.run(), for instance), will never
> happen for anything but the list of runnable tasklets.
>
> The tasklets in the chain of a channel are really, really
> blocked
Sorry, I wasn't confused about whether or not stuff is really
blocked. I'm pretty sure (I hope!) I understand how send() and
receive() on channels work. I was confused about _when_ context
switches happen. You said pre-emptive, and as I understand it, that
means "at arbitrary points in code". But if it's only switching on
blocked send()s and receive()s, that's not really arbitrary. At least
afaic. So will context switches ever happen at points _other_ than
send() and receive()?
--
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
---------+ http://twistedmatrix.com/users/radix.twistd/
More information about the Stackless
mailing list