Threads, IO handling, and Event Queues

claw at null.net claw at null.net
Fri Mar 14 15:08:53 CET 1997


On 10/03/97 at 08:53 AM, "Carter T Shock" <ctso at umiacs.umd.edu> said:

>I agree that multi-threading is not an issue to be taken lightly. I'd
>suggest that it only applies to the mud if you want to run different
>hunks of your world asynchronously. You could run different regions as
>seperate threads, unloading the threads when the region is devoid of
>players to reduce load. You could also run with each user as a seperate
>thread, but I wouldn't recommend it.

Or, you could take my approach: an event driven server where events are
transactions and compete simultaneously for compleation.

>One of the things I like about SillyMUD is the catastrophe code. The
>goblin raid on a town, the dwarf miner's revolt, etc. No reason you can't
>code up these "events" as a seperate process that runs, attaches to the
>mud, loads and tracks the appropriate critters, plays out its scenario
>and then cleans up after itself. 

Which is based on the premise that having an unused area defined or
otherwise "in the system" is wastefully resource consumptive, and doesn't
make a lot of sense to me.   Start with an event driven server and 90% of
this logic disappears.  Move from an in-memory image to on disk with
decent cacheing and the rest goes too.  Instead we are saddled with
iterative, polling, looping servers that spend most of their time either
doing things that aren't needed, or hoping to hell that the system loop
time is not so long that user performance goes thru the floor (cf
LambdaMOO).

>In essence, if you design well, you
>should be able to dynamically modify what's going on in your world
>without having to reboot.

Err, you write the above as if it were a "new thing".  The Tiny-* world
has been doing exactly this for years -- massively runtime modified and
defined worlds.

--
J C Lawrence                              Internet: coder at null.net
----------(*)                              Internet: coder at ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...





More information about the mud-dev-archive mailing list