lua-users home
lua-l archive

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


I was just reading through the list archives about coroutines and
cooperative multitasking.  Unfortunately, the external C-level
coroutine approach of 4.1 won't work for me, and I think I'm in the
same boat with many other game developers.  The problem is, the state
of Lua scripts must be serializable, and a C-level coroutine library
(or something using setjmp/longjmp) makes this unworkable.  I'm OK
with the restricted sleep() as described by Bret Mogilefsky.

I guess what's needed is a power-patch to make OP_CALL non-recursive,
and remove OP_TAILCALL from the compiler, and then a few support
routines.  It looks like Bret left some good pointers for how to do
it.  Before I duplicate this effort for the umpteenth time, does
anybody have any actual code to share?

-- 
Thatcher Ulrich <tu@tulrich.com>
http://tulrich.com