lua-users home
lua-l archive

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


> I am executing user code in Lua threads and I seek a low overhead
> means of terminating user tasks that exceed a predefined time limit.

Set an alarm and call lua_error in the alarm handler. You have to be careful
to handle the alarm in two steps: a signal handler that sets hooks
and a hook handler that raises the error. See lua.c or my lalarm.
--lhf