Can I make multiple Lua VMs in one thread?

As I know, I can create a Lua VM for each thread. But I'm not sure about multiple instances in the stream. Is it possible?

+4
source share
3 answers

You can create multiple states, but without threads or multiple processes, you can only run one of them at a time. In addition, you cannot communicate between states in the Lua core, so you need to either write your own or find a library to perform any synchronization or interstate communication.

0
source

Yes, you can just call the create function several times.

+6
source

comparing two references to objects using the operator == to true only if both references to the same object.

0
source

All Articles