From: TongKe Xue Date: 2007-07-09T07:18:15+09:00 Subject: Re: CPU/Memory limiting ------=_Part_185459_20837893.1183933098062 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I can't use Unix processes because we have too many objects. And we don't wnat to pay the >= 8KB kernel memory for each process. This is for simple stuff like: dog: if dist(owner) > 5 go_in_direction_of(owner) but we have crap loads of these objects; and we want them to be user scriptable (so C/C++ is a NO NO, we need an interpreted language), but we don't want people to do crap like: while(1) { get some more memory; } or calculate_ditits_of_pi(*) On 7/8/07, M. Edward (Ed) Borasky wrote: > > Travis D Warlick Jr wrote: > > TongKe Xue wrote: > >> 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. > > > > Try using Process#setrlimit. That being said, and aside from the fact > > that I love Ruby -- I don't recommend it for this type of "massive" > > endeavor. Always try to choose the best language for your application, > > not simply "the best language" because there isn't one. > > > > As for what I would recommend: Not a scripting language. For massive > > projects, use a compiled language on the back-end and then you may > > integrate it with Ruby on the front-end. > > > > ************************************* > > * Travis D Warlick, Jr > > * Lead Developer > > * Operis Systems, LLC > > ************************************* > > > > > Yes, nearly all of the open-source MMORPG frameworks/games are > implemented in C/C++ and most of them provide some kind of > controlled/controllable scripting capability. I did find *one* that is > Ruby-based (MUES/FaerieMUD) but I was unable to find any evidence that > it is currently active). "daimonin" seemed to be the closest to "baked" > but it is masked in Gentoo because of some outstanding security issues, > so I didn't experiment with it at all. > > ------=_Part_185459_20837893.1183933098062--