[Stackless] tasklet time out
singhai.piyush at gmail.com
Thu Mar 1 15:03:58 CET 2012
Yes Please post the code i will be very thankful to you.
On Thu, Mar 1, 2012 at 4:35 PM, Kristján Valur Jónsson <
kristjan at ccpgames.com> wrote:
> This has come up over here. We have been thining, for example, that
> tasklets should be able themselves to break out of "run", withough the
> currently hacky way of stackless.main.run()
> Also, some sort of "break" callback which can be called regularly to see
> if we ought to break, rather than rely on this weird "instruction count"
> In fact, with some slight modifications to stackless, it ought to be
> possible to write your own scheduler in a simple way. (The problem is that
> tasklet.run() leaves the caller runnable. Something like
> tasklet.run(remove=true) would be helpful as an atomic switching operation,
> allowing one to write one's own scheduler.)
> I wrote something like this once, can post the source if anyone is
> > -----Original Message-----
> > From: stackless-bounces at stackless.com [mailto:stackless-
> > bounces at stackless.com] On Behalf Of Richard Tew
> > Sent: 29. febrúar 2012 19:21
> > To: The Stackless Python Mailing List
> > Subject: Re: [Stackless] tasklet time out
> > On Wed, Feb 29, 2012 at 11:06 PM, piyush singhai
> > <singhai.piyush at gmail.com> wrote:
> > > Now suppose one of the tasklet stuck in while true loop or infinite
> > > loop because of the code bug you can say. Then no other tasklet will
> > > get the turn to execute. I want to avoid this scenario. I am trying
> > > to do using
> > > stackless.run(timeout) but this timeout is number of instruction.
> > You will have to make do with the instruction count timeout. There is no
> > support for actual time-based timeouts.
> > In my experience the instruction count timeout has been perfectly fine
> > this purpose. When you are pumping the scheduler, the theory is that
> > tasklets spend most of their time outside of the scheduler blocked on
> > channels. So the scheduler is expected to never block for very long,
> > wise or instruction count-wise. Just decide on a low enough instruction
> > count and you should be fine, a bit of experimentation should determine a
> > suitable value.
> > In practice, I've never seen our infinite loop detection kick in. I
> know it
> > definitely works, but infinite loops never happen in practice.
> > Cheers,
> > Richard.
> > _______________________________________________
> > Stackless mailing list
> > Stackless at stackless.com
> > http://www.stackless.com/mailman/listinfo/stackless
> Stackless mailing list
> Stackless at stackless.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Stackless