From: TongKe Xue Date: 2007-07-08T10:55:47+09:00 Subject: Re: CPU/Memory limiting ------=_Part_179324_17395308.1183859749950 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I think there is a misunderstanding. My goal is not to enforce these limits at compile time. My goal is to enforece these limits at run time. You exceed the memory limit? I don't allow you to allocate more memory. You exceed your cpu slice? I swap you out and run another thread for a while. On 7/7/07, M. Edward (Ed) Borasky wrote: > > TongKe Xue wrote: > > Hey Everyone, > > > > I'm working on a massive simulation project (like worldforge). I need > to > > be able to allow users to script objects in the world. I am thinking of > > ussing Ruby as my scripting language of choice. However: > > > > (1) I need to be able to limit the memory usage of the object. > > (2) I need to be able to limit the CPU cycle usage of the object. > > > > I.e. I don't want users to use my game to calculate digits of PI. > > > > Is there a way (or an existing implemntation of Ruby) to let me create > > these light-weight tasklets/threadlets/processlets (there's too many > > objects > > to have a UNIX process for each object) such that I can limit the > > memory/cpu > > usage on each? > > > > > > Thanks, > > --TongKe > > > > I don't think it's possible to use *any* Turing-complete scripting > language in such a manner, let alone Ruby. You'd be better off designing > your own language based on finite-state machines, for which you *can* > impose such control. > > ------=_Part_179324_17395308.1183859749950--