[Stackless] CPU/Memory limiting

Richard Tew richard.m.tew at gmail.com
Sun Jul 8 10:15:19 CEST 2007


On 7/8/07, TongKe Xue <tongke at gmail.com> 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.
>
>   I.e. I don't want users to use my game to calculate digits of PI.
>
>   Is there a way 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?

These are really general Python problems and if you can solve them in
general, then you can most likely adapt the solutions to apply the
limitations on a per tasklet basis.

You would be best to ask in the comp.lang.python newsgroup.  If I were
solving something like this, I would look at PyPy as well:

http://codespeak.net/pypy/dist/pypy/doc/news.html

Cheers,
Richard.

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list