lua-users home
lua-l archive

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


Hello,

I'm using LUA for a simulation on a cluster system, so my user can define their own scripts. In some cases there exists a infinite loop or infinity recursion in the LUA code so the simulation does not stop anymore.
My idea is to create a maximum execution time (like PHP) with a watchdog (I don't use a formal verification of the code e.g. wp-calculus). Each script has got a defined function which is called by my C++
class, so I would like to send the LUA script a "warning" that the max. execution time is reached, but if the script does not stop, the C++ side should stop the script.

Can I / How can I stop a running script from C side?
Do you think it is a good idea to send a warning first, because the script does not use threads, so IMHO the warning can not be handled by the script?
I hope for some ideas

Thanks

Phil