[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: kill coroutine
- From: Mike Pall <mikelu-0508@...>
- Date: Sun, 21 Aug 2005 15:18:37 +0200
Rici Lake wrote:
> atomic(), line 539:
> markobject(g, L); /* mark running thread */
> The comment leads me to believe that the intention is to mark the
> running thread, which would seem logical.
Ok, missed that one. But IMHO this only hides violations of
the referential model a bit longer. Not holding a reference
to a coroutine is a bug. Making the crash more likely (by
letting it happen even while the coroutine is running) may
lead to earlier discovery of the bug.
The other question is whether it's possible to catch this
kind of error a bit more predictably. IMHO there is not
much one can do except running a full GC in lua_resume()
and then checking whether the coroutine is still alive. But
this is probably too slow and it could hide other errors, too.
Maybe an extra assertion. But those who are most likely to
make this mistake are the least likely to turn on assertions.