[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Nonblocking script execution
- From: Asko Kauppi <askok@...>
- Date: Wed, 25 Feb 2009 10:08:27 +0200
Alexander Gladysh kirjoitti 25.2.2009 kello 1:59:
On Wed, Feb 25, 2009 at 2:39 AM, Alex Davies
I did a quick, nonreliable test, and it took about 14 times
longer with a
C hook. Also, another problem I thought of: what if the script
makes an IO
call?It'll still block...
It is a problem - your whole C library needs to either have a
worse case time (even Lua's standard library doesn't offer this,
string/io/table libraries can take a long time performing their
functions) or check the debug hooks themselves.
This one takes 4 seconds on my box, and has just 9 instructions.
While one can take away IO from untrusted code, string library is
usually a requirement...
Quite smart to think of this kind of issues; I've never realized them.
The only solution I'm aware of that currently offers cancellation of
Lua states from the outside is Lanes. It will _really_ kill runaway
cases, from the OS threading level, and then close their Lua states.