[MUD-Dev] TECH: Single process v.s. multi process?

Philip Mak pmak at animeglobe.com
Sun May 26 13:53:12 New Zealand Standard Time 2002


As I understand it, when building a MUSH codebase from scratch, I can
do it one of three ways:

  (1) Single process: A single process that listens for player
  connections on a TCP port and handles everything.

  (2) Multi process: Run xinetd/tcpserver to spawn a program for
  each connection to a TCP port. These programs interact with some
  centralized database/message queue.

  (3) Multi thread: A single program that listens for player
  connections and spawns a thread for each of them.

I'm only familiar with #1 from my experience with PennMUSH. One of
the problems with #1 is that it's hard to defend against malicious
softcode that consumes too much resources. For example, if I input a
complicated command with many function evaluations, it will lock up
the whole MUSH for several seconds. If I manage to generate a stack
overflow, it will crash the whole MUSH. (It's trivial to crash any
PennMUSH in three commands, except those running 1.7.5p5+ with
call_limit enabled.)

Does anyone have thoughts on how #2 or #3 would work? 
Synchronization between the multi-threads or multi-processes would
be an issue.
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list