chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Continuations in C


From: Daniel B. Faken
Subject: [Chicken-users] Continuations in C
Date: Thu, 8 Sep 2005 19:36:23 -0400 (EDT)

Hi,

  I just ran across this and thought it might be useful/interesting for 
Chicken:
  From http://luajit.luaforge.net/coco.html:
"Coco is a small extension to get True C Coroutine semantics for Lua 5.1.

True C coroutine semantics mean you can yield from a coroutine across a C 
call boundary and resume back to it.

Coco allows you to use a dedicated C stack for each coroutine. Resuming 
and yielding to/from a coroutine automatically switches C stacks, too.

In particular you can now:

    * Yield across all metamethods (not advised for __gc).
    * Yield across iterator functions (for x in func do).
    * Yield across callbacks (table.foreach(), dofile(), ...).
    * Yield across protected callbacks (pcall(), xpcall(), ...).
    * Yield from C functions and resume back to them.
"

I have been thinking lately about how to do continuations including the C 
stack lately; this may be relevant

cheers,
Daniel






reply via email to

[Prev in Thread] Current Thread [Next in Thread]