Re: Threads?

From: George (greerga@CIRCLEMUD.ORG)
Date: 01/26/98


On Mon, 26 Jan 1998, Sean Butler wrote:

>Has anyone made a modification of circle to use threads?  What advantages
>do you think they would give?  What disadvantages?  Would performance
>increase or decrease?  What areas of the mud would be best benefited from
>them and why?

Actually, yes I did.  The only real advantage in the way I implemented it
is that if your MUD gets stuck in an infinite loop or something takes too
long (like 2.1 billion dice rolling), the processing thread can be killed.
Then it restarts the processing again, but of course, the world may have
some inconsistency in it after doing that depending on when it loops.  The
way I did it is the only way I can think of, you cannot have multiple
processing threads because of the 4 global buffers.  I basically split it
into 'Network I/O' and 'Character Processing' with a backward compatible
option if thread creation fails.

There isn't a performance increase I don't think.  The ideal way would be
for each player to have a thread but the current structure of CircleMUD
makes that impossible. (Unless using my buffer patch which takes care of
the biggest obstacles: buf, buf1, buf2, and arg.)

Ideally it would be great, but as of current, it just prevents infinite
loops.

(Located on my project page if you're interested.  It does run
properly AFAICT but I didn't test it with more than three people.)

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST