lua-users home
lua-l archive

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


Benjamin Tolputt wrote:
> Hmmm, that's a pickle. I was hoping the combination of both would give
> me a serializable green-threaded environment with semi-native speed. So,
> if I am correct in my understanding, LuaJIT discards the lua bytecode
> and position information replacing it with a C-stack that we cannot
> serialize using pluto (as it is no longer a Lua frame).

The C stack frames created by the machine code from LuaJIT 1.x
actually mirror the frames in the Lua stack. But there may be some
intervening frames from C functions which cannot be reconstructed
easily. And persisting only the C stack of an arbitrary C program
is intractable. The stack may contain pointers to heap-allocated
objects which can end up at different addresses for different runs.

> Or to continue on the same line of thought, perhaps this would not be
> necessary given the new architecture of the LuaJIT 2.x (as outlined in
> February's roadmap).

Yes, LuaJIT 2.x doesn't switch between different C stacks for
coroutines anymore. A suspended coroutine could be serialized with
some effort. But the internal data formats are not compatible with
standard Lua, so you won't be able to use Pluto at all. I probably
need to add a native serialization module at a later time ...

--Mike