When is lua coroutine created by create_thread freed/destructed from memory?
surajprak opened this issue · 1 comments
surajprak commented
I am having a single instance of rlua::Lua. I am iterating inside a future mpsc loop and in each iteration creating a coroutine using rlua create_thread. I want to understand few things
- what is the memory size allocated per coroutine and
- when is this coroutine object destructed? Is it destroyed when this coroutine completes?
leo60228 commented
create_thread
is a simple wrapper over lua_newthread
. The lua_newthread
docs say:
There is no explicit function to close or to destroy a thread. Threads are subject to garbage collection, like any Lua object.