lua-users home
lua-l archive

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



On Oct 10, 2009, at 10:50 PM, Travis Baker <echo1001@ungclan.com> wrote:

I had thought about that, but I'm not sure how to break out of the loop once a threshold was reached.

In most cases it's easier and more logical just to shutdown the script. Breaking the loop would probably screw something up and you'd have to reset anyway.



On Sat, Oct 10, 2009 at 8:52 PM, Stuart P. Bentley <stuart@testtrack4.com> wrote:
debug.sethook will let you count the number of line executions.
 
Of course, perfect infinite loop detection is, in fact, impossible (http://en.wikipedia.org/wiki/Halting_problem). Ask Garry how he's doing it (probably by a C hook).

Sent: Saturday, October 10, 2009 P5:33
Newsgroups: gmane.comp.lang.lua.general
Subject: Infinite Loop Detection

I've seen infinite loop detection used in applications before. (Garry's Mod)

Does anyone know how to go about creating something like this. It doesn't have to necessarily check for an infinite as much as hit a threshold limit for how many time a loop can repeat itself.

Any Ideas? Thanks