[MUD-Dev] Collecting ideas for a MUD server... (fwd)

Rahul Sinha rsinha at glue.umd.edu
Wed Dec 22 21:54:37 CET 1999


ready for a me-too email ;-)
basically I agree with JCL here, a few things I wanted to elaborate on...

On Wed, 22 Dec 1999, J C Lawrence wrote:

> On Wed, 22 Dec 1999 13:54:23 -0800 
> Justin Rogers <justin at mlstoday.com> wrote:
> 
> > [Rahul Sinha]
> >> ??? multithreaded USERS?
> 
> > Each user has his own thread that he runs in.  Works for up to
> > about 20 users.  
> 
> Ouch.  Let alone the performance problems with large numbers of
> threads on almost all current systems (and in particular the current
> Windows* base IIRC), this (as you note) scales horribly.

hear hear! keep in mind, multiple threads ought not seperate themselves on
seperate cpus due to cache coherency issues (depends on your OS if they
do) and either way, the only reason to have threads is to eliminate wait
for blocking operations. (iow, you should be able to work while waiting
for something)  If you have one thread-per-zone, each thread can iterate
across the actions provided by the users, and any blocking that needs be
done (eg database access hits, which are fast, but if you want your ticks
to be under a second, should be considered blocking operations) does not
stop the entire program, the cpu can go work on another zone.

blocking is an issue for the network code, but there we just use separate
processes... ;-)

> 
> > I modified this later though.  Each area runs in its own thread,
> > and large groups of NPCs have their own threads.  All in all about
> > 50 threads get spawned during an uprun.
> 
> And how do you handle users visavis your thread model?

data coherency important, many threads accessing one datapoint bad.
one-thread-per-zone handles that in a decent fashion, as most of the data
involved is organized that way anwyay, and the db can keep the general mud
data structure clean

> 
> >     No not at all.  It isn't quite like that.  I do keep a global
> > player up.  But they are still playing the game.  Users transfer
> > their information around to others as they are playing.  So if you
> > log into the system and your user profile doesn't match the user
> > profile that everyone else has of you then you get kicked.

ummm why not just have a server app? peer-to-peer is only employed when
the overhead of a server makes it not worthwile, but here that is not the
case (it is worthwile)

you gain completely trustworthy data
you gain a shallow client (a good thing, not everyone has a kick ass
computer, let them render graphices, you do everything else)


	Rahul Sinha
Computer Science/ Government,
University Of Maryland College Park
AIM: qui dire	ICQ: 9738191	(301)935-5542





_______________________________________________
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