[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: C API Bytecode Incrementer [Lua 5.2?]
- From: Patrick Donnelly <batrick@...>
- Date: Wed, 29 Apr 2009 00:28:06 -0600
I mentioned in a previous post  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.
"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."