lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 20-Aug-05, at 7:19 PM, David Given wrote:

I am curious to know what happens if a coroutine nils out its own last
reference, though. Does the program counter carry an implicit reference to
the code its executing? What happens when the coroutine yields?

The currently running thread (and therefore its stack) are always part of the gc root. So is the "main thread" (and its stack).

If there is no reference left to a coroutine and the coroutine yields, then it will get garbage collected at some point.