[Stackless] Stackless based replacement

Larry Dickson ldickson at cuttedge.com
Fri Oct 3 22:03:50 CEST 2008


Hi Arnar,

I was being really brain-dead, of course, when I started going on about
interrupt coding. You don't have to do any. C select does all that for you,
just as shown in your own code snippet for time.sleep...

On 10/3/08, Arnar Birgisson <arnarbi at gmail.com> wrote:
>
> Hey Larry,
>
> On Fri, Oct 3, 2008 at 20:56, Larry Dickson <ldickson at cuttedge.com> wrote:
> > Am I right, that your answer to (1) is that Tasklet L is the one with
> > "event.loop(TRUE)" and that that is the call that continually checks
> > readiness for other tasklets?
>
> Yes, that is correct.
>
> > The "elaborate handler when select comes out of the block" is really
> pretty
> > trivial, and was done decades ago by Inmos - who recorded a bit-by-bit
> > description of their absolutely robust implementation. They actually
> solved
> > a tougher problem, which was to let you code a multi-way branch in a
> single
> > process (not just select the winning process with one stimulus to each,
> as
> > we have been discussing), and included timers too.
> >
> > Your implementation of time.sleep looks like it's interrupt-based, so I
> > guess you have a fast clock on your motherboard, unless C select is coded
> > pretty weirdly.
>
> Just to be clear, it is not *mine*, it is from the CPython source.


Ah, the ambiguity of English "you" - I meant "the implementation of you
Stackless coders" - then confused it by adding "thou hast a fast clock on
thy motherboard" ;-)

> This particular kind of interrupts and locking code is not as hard as you
> > think, because it only has to serialize the queue manipulation for
> something
> > you completely control - the Stackless virtual machine. I did it in DOS
> ages
> > ago, and the Inmos documentation exhaustively lists what is needed, which
> > isn't much (currently the "Transterpreter" project works off that). It's
> > your call, of course, but I think readiness queueing is much cleaner
> without
> > requiring a timer poll loop.
>
> I'd be interested to see an implementation :)


I'll put some notes together over the weekend and send them along - I have
to pull it out of non-digital 1988 references.

Larry

cheers,
> Arnar
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20081003/ef6c94e8/attachment.htm>


More information about the Stackless mailing list