[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lua_newstate vs lua_newthread
- From: Jinhua Luo <luajit.io@...>
- Date: Fri, 26 Jun 2015 16:37:01 +0800
Sometimes we need to use the whole lua vm as work unit, e.g. dispatch
the work unit among OS threads. However, it's a bit overhead at the
lua_newstate and lua_close. Is it feasible to reuse the vm after
cleanup (keep sandboxing)?
See my simple idea (it's simple and far from perfect, and it doesn't
consider registry changes via C API):
https://gist.github.com/kingluo/ad5c40047bd41ab05d5e
Any suggestion?