On 02/05/12 11:28, Victor Vasiliev wrote:
The scenario
you give in brackets will not happen. If a Lua timeout
occurs when the parser is executing, the Lua script will terminate
when the parser returns control to it. The timeout is not missed.
But the parser working time would still be included in normal Lua time limit?
For LuaSandbox, yes the parser time is included. For LuaStandalone the
parser time is not included in the limit, but it could be measured
using getrusage() if that were deemed important.
It doesn't
matter if there are several levels of parser/Lua recursion
when a timeout occurs. LuaSandbox is able to unwind the stack efficiently.
What I meant is that it should be able to handle the time limit
correctly and avoid things like doubling time because of the nested
scripts.
Yes, that is done correctly also. Each LuaSandbox object has a single
timer which is started and stopped at the base recursion level and
ignored at higher levels of recursion.
-- Tim Starling