[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: how to restrict lua syntax for files to be loaded
- From: pansz <pan.shizhu@...>
- Date: Tue, 27 Mar 2012 13:36:11 +0800
On Tue, Mar 27, 2012 at 5:12 AM, Egor Skriptunoff
<egor.skriptunoff@rocketmail.com> wrote:
> IMHO, it is worth to introduce "super protected call" function
> superpcall(maxCPUTime, maxMBytesOfMemory, f, arg1, ...)
> for limiting CPU and memory usage.
I think you can put the super-protected-call in a separate lua_State
and run the state in a separate thread/process. Monitoring cpu and
memory usage can be done in your C host program.