[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C API Bytecode Incrementer [Lua 5.2?]
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 29 Apr 2009 08:48:47 -0300
> I mentioned in a previous post [1] the idea of incrementing the
> bytecode count using an API function provided by Lua (e.g.
> lua_incbc(lua_State *L)). This would allow libraries that could
> potentially execute for long times (like the string pattern matching
> functions) to periodically increment a byte count that would allow a
> debug hook to run and possibly stop execution. This would be
> especially nice in Lua 5.2 if Mike Pall's coroutine patch is applied
> so we can enforce run times (using lua_yield) in our threads.
>
> [1] http://lua-users.org/lists/lua-l/2009-02/msg00501.html
>
> Thoughts?
If the stop occurs "during" the call to lua_incbc, then the caller should
be albe to be recalled to continue later (unless we have C coroutines).
If the stop does not occur during that call, it still may occurr too late
(only after the C function finishes).
-- Roberto