[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Cloning "preforked" Lua state
- From: Scott Vokes <vokes.s@...>
- Date: Sun, 6 Sep 2009 14:49:34 -0400
On Sun, Sep 6, 2009 at 2:09 PM, David Kastrup<email@example.com> wrote:
> Consider coroutines as pretty much the same as subroutines. The
> principal difference is that they don't give up stack, instruction
> pointer and local variables (the dynamic execution context) while
> returning execution control and return values. They pass the buck
> without passing away.
There's also a VM patch from Mike Pall that adds a
coroutine.clone function. (Any chance that will ever become part of
the core language?) I haven't used it for anything very serious yet,
but it could potentially be very useful.
: http://lua-users.org/lists/lua-l/2006-01/msg00652.html , and note
the minor correction in the followup e-mail.