lua-users home
lua-l archive

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

Folks, is there a way to clone a Lua state? I tried to google around
but found nothing really meaningful(correct me if I'm wrong, please).

In my game application the initialization procedure of the Lua virtual
machine is pretty heavy(about 1 sec, since many scripts are loaded at
once). I have a separate Lua vm for each autonomous agent and once the
agent is created its Lua initialization affects FPS pretty badly.

I'm thinking about the following schema: what about keeping
"preforked" Lua state which is then simply cloned for each agent? Is
it possible?

Thanks in advance

Best regards, Pavel