[Stackless] Watchdog and Channel Receiving in C
Dave Butler
dave at hoppit.net
Tue Apr 19 16:16:20 CEST 2011
Weird, I could have sworn that was the first thing I tried and it didn't
work. I must have had some other bug at the time that has subsequently
been fixed since it works just fine now. Thanks to both of you.
Dave
Kristján Valur Jónsson wrote:
> That’s a very roundabout way to do it.
>
> Simply set the channel’s preference to 1 (sender preference) and the
> receiver will be scheduled to run in its own good time.
>
> K
>
> *From:*stackless-bounces at stackless.com
> [mailto:stackless-bounces at stackless.com] *On Behalf Of *David Butler
> *Sent:* 18. apríl 2011 23:57
> *To:* The Stackless Python Mailing List
> *Subject:* Re: [Stackless] Watchdog and Channel Receiving in C
>
> It turns out that the problem was in how I was sending the message. I
> was sending straight from C with PyChannel_Send(), and it was firing off
> all the code immediately. If I instead spawn a tasklet that sends the
> message, everything is scheduled under the watchdog properly.
>
> On Apr 18, 2011 6:26 PM, "Richard Tew" <richard.m.tew at gmail.com
> <mailto:richard.m.tew at gmail.com>> wrote:
> > On Tue, Apr 19, 2011 at 1:34 AM, Dave Butler <dave at hoppit.net
> <mailto:dave at hoppit.net>> wrote:
> >
> >> I've browsed through some of the stackless code, and I'm not
> entirely sure
> >> what is happening in there. It appears to me that when data is
> received on
> >> a channel, it immediately fires off the rest of the function rather than
> >> scheduling it for execution? I may be entirely wrong here...
> >>
> >> Has anyone encountered this at all? I'm happy to delve into and make
> >> changes to the stackless code if necessary, or if someone knows a better
> >> method to achieve the same thing I would appreciate any pointers. I
> would
> >> prefer to go under the assumption that script-writers do NOT know how
> >> stackless works and should not be required to do any cooperative
> scheduling
> >> themselves. Feel free to let me know if I was unclear on any particular
> >> points.
> >>
> >
> > Hi Dave,
> >
> > How a channel behaves with regard to scheduling when an operation is
> > performed on it, is determined by its preference attribute. See this
> entry:
> >
> >
> >
> http://disinterest.org/resource/stackless/2.6-docs-html/library/stackless/channels.html#channel.preference
> >
> > And this entry:
> >
> >
> >
> http://disinterest.org/resource/stackless/2.6-docs-html/library/stackless/channels.html#channel.schedule_all
> >
> > Cheers,
> > Richard.
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list