[MUD-Dev] Re: Scripting languages

Kwon J. Ekstrom justice at softhome.net
Wed Jul 2 17:35:42 CEST 2003


MIKE MacMartin wrote:
> On July 2, 2003 12:02 pm, justice at softhome.net wrote:

>> With a relatively small amount of code (under 2 printed pages),
>> Rhino allows me to control exactly what classes can be
>> instantiated.  Without some additional code, a watchdog prevents
>> infinite loops.

> I have a question: How would one write such a watchdog?  Perhaps
> run the interp in its own process having a connection to the mud?
> What about a separate thread?  How could one write a sandbox
> thread such that it kicks out after a certain amount of time of
> idle?

> I'm going to allow my players access to TCL scripts (at least
> builders up) and I don't want to let inf. loops and some things
> through.  Another option is to have it go through an imm for
> approval?

It depends on the system.

For my game, the core engine is "mostly" single threaded.  IO,
scripts, and the watchdog run in separate threads, the rest of the
engine runs in a single thread.

First thing after a sleep, each thread marks the time, and the
watchdog looks at this to determine how long the thread has been
working.

If a thread exceeds it's threshold, then the watchdog thread takes
appropriate action.

Scripts are run in a background thread to prevent them from blocking
the main loop, and I maintain a small pool of threads for them to
use.

-- Kwon J. Ekstrom
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list