[MUD-Dev] Multi-threaded mud server.
Jon A. Lambert
jlsysinc at ix.netcom.com
Mon May 17 01:03:47 CEST 1999
On 16 May 99,, Caliban Tiresias Darklock wrote:
> On 08:42 PM 5/16/99 +0000, I personally witnessed Ross Nicoll jumping up to
> say:
> >
> >The MUD creates as many threads as processors, and then allocates players
> >and computer characters in such a way that load on each processor should
> >be roughly equal. This should keep context switching to a minimum.
>
> Maybe I don't understand context switching -- my understanding of threads
> is minimal -- but this sounds fallacious. As I understand it, context
> switching is when one thread gives way to another thread, which means its
> state (context) needs to be saved and the other's has to be restored
> (switching).
>
Yes, but I can't for the life of me figure out why it's so damn important
to avoid. ;)
Here's a common example:
There exists a 400 mhz Pentium II single-processor with 64 Mb of memory
running Redhat Linux. Running on the server is ftpd, httpd, telnetd,
smptd, dns, a stock Diku mud server, a DGD LP mud server, and a ColdMUD
server. The server is probably underloaded.
Is there context switching going on here? YES! Loads and loads of the
"expensive" process-level context switching.
<rant>
Now suppose I wish to redesign and multi-thread that Diku mud server.
Why would I WORRY about the overhead of "cheaper" thread-level context
switching?
Why should I CARE at the application-level how many processors are
present on the friggin box!?!@#!??
</rant>
--
--* Jon A. Lambert - TychoMUD Email:jlsysinc at ix.netcom.com *--
--* Mud Server Developer's Page <http://pw1.netcom.com/~jlsysinc> *--
--* To fight the empire is to be infected by its derangement. Whosoever *--
--* defeats part of the empire becomes the empire; it proliferates like a *--
--* a virus... thereby it becomes its enemies." -- P.K. Dick *--
_______________________________________________
MUD-Dev maillist - MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list