lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:
> 
> Having a line hook always active can slow down your program. If your system
> has support for timers or alarm you can set up a timer or alarm handler
> and in it, when the event happens, set a line or call hook to handle the event.
> The lua.c interpreter does something similar to handle interrupts.

Be careful.  Afaics lua_setlinehook/lua_setcallhook are no longer signal save.
They may deadlock due to lua_lock.  And setlinehook seems to depend on
complex data structures which may not be stable during a signal handler.
It becomes tricky...

Ciao, ET.