lua-users home
lua-l archive

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


On Jun 19, 2008, at 6:20 AM, Asko Kauppi wrote:

When you give parameters to a new state, or read a ready state's return values, this is done without serialization, as a direct state- to-state copy (in Lanes, at least). Therefore the operation might not be as heavy-weight as you may think. Whether it's speedy enough depends of course on each situation.

When data is passed between two running states (in Lanes), serialization is used, since it does not require the states to be synchronized.

Still, as a general rule "separated" approach does suit better to "bigger grain" multithreading, where each Lua state is akin to OS processes.

If state-to-state copying is sufficiently cheap, then you can use an intermediate state with a lock around it to decouple the running states:

http://www.lua.org/wshop05/Hamburg.pdf

Mark