Is it possible to share a table between multiple lua_State in a single threaded application?

StackOverflow https://stackoverflow.com/questions/17653530

  •  03-06-2022
  •  | 
  •  

문제

I have a table in one Lua script which I want to share with other Lua scripts, which are loaded in different lua_State, so they can call methods in that table. Is it possible to do that?

도움이 되었습니까?

해결책

No, unless you copy the data between states manually. Lua states are completely separate. Lua threads on the other hand share data. But do not confuse those with OS threads.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top