lua-users home
lua-l archive

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


You mean a limit to the time a script runs before it is cancelled? I
don't think that is possible right now in LuaJIT. LuaJIT emits pure
asm code, and if that code is in a loop, it just runs the loop as long
as it likes.

I am thinking about a process to patch arbitrary Lua code in order to
have it check a time limit at well-defined intervals (even when run in
LuaJIT). But that takes some work.

So probably all you can do right now is kill the whole thread/process
from outside.

I'm not even sure if I get your question though. What's luaV_execute?

On Fri, Sep 2, 2011 at 8:45 AM, wang peng <w2moon@gmail.com> wrote:
>      i have some problem when i want to add time limitation code in
> luaV_execute.
> Luajit doesn't have luaV_execute,It uses lj_vm_pcall, an asm function,
> instead.
> And i can't use thread in my program.
>    Can anyone give me some help on how to add time limitation code in
> lj_vm_pcall?
>
>