Threads, IO handling, and Event Queues

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Thu Mar 6 07:26:20 CET 1997


:In any case, I would be interested to see how the rest of you implemented
:event queues, multithreading, etc...

First, I'll comment about the goblin-fight and flee example. I don't like
computer games that ignore my commands. I think I mentioned this when
Chris L suggested something like it. One of the reasons why people play
computer games, I think, is because the player is in some ways in full
control. That will be lost if not all commands are executed, or if things
are not done in the way the player specified. I wouldn't be surprised if
some user's reacted very strongly to such things.

On to your question. As you probably already know, I don't really have
any of that stuff. I have a queue of timed code call-outs, which are
executed as soon after their indicated time as possible. That's it.

As for multi-threading, I would advocate understanding why you want to
use it, before you devote much time to it. A program with multiple
threads will run slower on a single-CPU computer than the equivalent
program without threads. If you truly are targetting speedups by running
on multiple CPU's, then fine. If not, then reorganizing your server into
threads had better produce some real improvements in maintainability,
etc., in order to offset the loss of speed.

Personally, I believe that moving in the direction of not only threads,
but multiple co-operating servers is important. Multi-player games will,
I think, only get bigger, so we will need extra power to run them. It
isn't going to be easy - that's why there really aren't any good
distributed MUD servers yet.

--
Chris Gray   cg at ami-cg.GraySage.Edmonton.AB.CA



More information about the mud-dev-archive mailing list