Is there any possible way to copy one lua_state to another?

  • From: "??????" <stephenmax@xxxxxx>
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Thu, 17 Sep 2015 16:14:12 +0800

Hi there,

Is there any possible way to copy one lua_state to another?
My application have several c thread, and each one of them need their own
lua_state.
They share same conf files, so each c thread need load the same lua files by
there own.
So can I let the first c thread establish the lua environment(such as global
tables), then just copy this lua_state (of course also copy global tables) to
remaining threads?
And I dose not want those lua_state to share same environment like
lua_newthread does.
I know this is not a luajit specific question, just think guys in here are far
more experienced :)

Other related posts: