Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个 Lua 脚本中有一个表,我想与其他 Lua 脚本共享,这些脚本加载到不同的 lua_State 中,因此他们可以调用该表中的方法。有可能这样做吗?
不,除非您手动复制状态之间的数据。Lua 状态是完全独立的。另一方面,Lua 线程共享数据。但不要将它们与操作系统线程混淆。