[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

28257: Re: [MUD-Dev] Re: Scripting languages

[Full Header] [Plain Text]
From: "Kwon J. Ekstrom" <justice@softhome.net>
Newsgroups: nu.kanga.list.mud-dev
Date: Wed, 02 Jul 2003 17:35:42 -0600
References: [1] [2] [3] <-newest
Organization: Kanga.Nu
MIKE MacMartin wrote:
> On July 2, 2003 12:02 pm, justice@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@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev