lua-users home
lua-l archive

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


On Tue, May 26, 2020 at 2:48 PM Viacheslav Usov <via.usov@gmail.com> wrote:
>
> I am not talking about the real or imaginary problem from which this
> thread started. I am talking about a simple fact: in year 2020 as well
> as in year 2000, any serious user of Lua often needs a way to
> interrupt a running Lua VM, asynchronously, i.e., from a signal
> handler or another thread. The standalone Lua interpreter, which has
> been doing just that since said year 2000, demonstrates this
> convincingly. This, of course, should not mean that lua_sethook()
> should be the means toward the need. I, for one, would prefer
> something else, which does only one job: the interruption. Whatever
> the means is, Lua NEEDS such a means, and it NEEDS to be documented as
> such, with limitations if any (see below).

Roberto pointed out that this still can work in Lua 5.4; you just need
to make sure you use LUA_MASKCALL as well as LUA_MASKCOUNT. I'm happy
now that I know that works. If anything needs to be done at this
point, it's just adding that to the docs. The one case where my patch
would still be useful is if you wanted it to be easy to interrupt
coroutines, but since that's an entirely new feature, it's definitely
not worth changing 5.4 this late just for it.

Joseph C. Sible