From: Logan Capaldo Date: 2007-07-08T09:24:16+09:00 Subject: Re: Ruby for MMORPG Scripting ------=_Part_9716_2910270.1183854256900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/7/07, 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? Not really as far as I know. You can try using Timeout to limit the amount of time a given task runs, but that is certainly not infalliable. Short of creating your own ruby impl. / heavily modifying another ruby impl. the only way I could think to do this would be to make each a process and use the OS facilities (which you said you didn't want to use). Unless maybe java has per thread cpu / memory limits, in which case you might get jruby to do what you want. Thanks, > --TongKe > (When replying, please do reply all as I might unsubscribe due to the > traffic.) > > ------=_Part_9716_2910270.1183854256900--