Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it okay calling Lua function from different thread(embedding Lua in C++)?

Tags:

c++

lua

I'm using VS2008, lua 5.1 and luabind 0.9.1.

Calling Lua function from C++ works just fine.

If there're several threads and Lua function is invoked from each thread, has this situation any problem? There is only ONE Lua state.

In that situation, should I have more Lua state? Which one is common?

like image 960
Hongseok Yoon Avatar asked Nov 15 '25 13:11

Hongseok Yoon


1 Answers

That's not OK just like that. The Lua users wiki has a nice page about threading.

like image 100
jpjacobs Avatar answered Nov 17 '25 09:11

jpjacobs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!