[MUD-Dev] Re: TECH: Distributed Muds

Bruce bruce at puremagic.com
Wed May 2 01:24:09 CEST 2001


Kwon Ekstrom wrote:
> From: "Chris Gray" <cg at ami-cg.GraySage.COM>

>> In any case, do you really want to have no limit on softcode
>> execution?  No matter how many threads you give to your execution
>> system, if the bad softcode is hit enough, you are still in
>> trouble. Not only in the CPU usage, but possibly also in the memory
>> tied up and maybe even locks held.

> In the multi-threaded system, logging whenever softcode takes too
> much cpu time would be a better approach imho.  A timeout might
> work, but if you're in the middle of a delicate operation that
> modifies values that may be used by other computations, it could
> result in bad data being passed, and that IMHO would be worst than
> the cpu time.  Softcode's purpose is to allow parts of the game to
> be modified online, and bad code could be corrected somewhat easily
> (depending on circumstances of course)

Another approach here, and one that I'm working on employing myself,
is the use of things like CLOCK_PROCESS_CPUTIME_ID and
CLOCK_THREAD_CPUTIME_ID with clock_gettime(), if your OS supports
these things.  Linux with glibc 2.2 (not sure if there is a kernel
version requirement) supports those, while FreeBSD 4.2 and Solaris 7
don't appear to.  (Although, some of the same information is available
through getrusage() as well, which is older and much more widely
supported.)

I'm tying that into the task accounting code that is being added to
Cold to help with monitoring what's going on at a much lower level
within the driver.  (Think top-for-Cold.)  This'll likely be in the
next Genesis release, whenever that happens.

I don't know what type of info like this is available within Java
(which is what you're using?), but for those of us in C/C++ or
languages that interface cleanly with those, it is nice.

On a related note, I haven't seen a nice way of determining the stack
trace for a given thread.  I'd love to know how to do this.  I can
walk a stack upwards given a jmp_buf, but what I really want to do
here is be able to determine exactly what all of the threads in a
running system are doing at any point in time.  This would obviously
be platform-specific code, which is fine with me. :) Anyone done
anything like this?

  - Bruce

_______________________________________________
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