How bad is it in Lua 5.1 to never let a coroutine end properly? In other words, if coroutine gives, but I never resume it, will it leave a lot of state lying until the program ends?
cor=coroutine.wrap(somefunc) while true do done=cor() if done then -- coroutine exited with "return true" break else -- coroutine yielded with "coroutine.yield(false)" if some_condition then break end end end function somefunc() -- do something coroutine.yield(false) -- do some more return true end
Depending on some_condition in the pseudo-code above, the coroutine can never be resumed and, therefore, can never “finish”.
Can I do this with dozens of coroutines without worrying? Is it possible to leave coroutines in this state? It is expensive?
coroutine lua
proFromDover
source share