> I have a C# application with IronPython scripting. I wonder, is it > possible to prevent users from creating infinite loops in their > scripts? > > So for example, if a script is executed which contains a loop, and loop > is infinite, would it be possible for my C# application to detect this, > perhaps by having a maximum loop cycle count? Thus preventing my > application from hanging... > > I've tried googling around on this subject but I've had no joy. Maybe > what I'm asking for isn't possible?
There is no general solution: http://en.wikipedia.org/wiki/Halting_problem But you can stop your app from hanging by running scripts on another thread. You can also stop the thread after a certain amount of time, thus accomplishing a similar thing as a cycle count. However, again, there is no general solution. _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
