lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Lua Lanes allows you to give specific OS level priorities to the Lua states you are running, and/or aborting them completely if necessary. It kind of helps you do the kinds of sandboxing that Lua is good for, without going "inside".

The tips Irayo gave seem very valid, though, and using debug features + os.clock() is maybe enough for your tasking needs?

If running potentially on multicore machines, you might consider Lua Lanes for fully utilizing them, though. In an easy way.


TongKe Xue kirjoitti 8.7.2007 kello 3:24:

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 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?