[Stackless] tasklet time out

Kristján Valur Jónsson kristjan at ccpgames.com
Thu Mar 1 17:00:24 CET 2012

Note that this is not very well tested and may be completely bogus.

From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of piyush singhai
Sent: 1. mars 2012 14:04
To: The Stackless Python Mailing List
Subject: Re: [Stackless] tasklet time out

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<mailto: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" thingie.

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 interested.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20120301/08ce3ae3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scheduler.py
Type: application/octet-stream
Size: 3884 bytes
Desc: scheduler.py
URL: <http://www.stackless.com/pipermail/stackless/attachments/20120301/08ce3ae3/attachment-0001.obj>

More information about the Stackless mailing list