[MUD-Dev] New to MUD Dev, need friendly advice!
jo at groupinfo.com
Wed Apr 30 09:33:05 New Zealand Standard Time 2003
On Wed, Apr 30, 2003 at 10:42:14AM +1000, Byron Ellacott wrote:
> On Thu, 2003-04-17 at 05:04, Lance Rotten wrote:
>> 1. Connections - What is the best method for accepting multiple
>> connections? Ive heard individual threads are an awful idea,
>> and that thread pools are a better idea. But I know there must
>> be a much better way to do this. Say I want to have 1000 people
>> connected at once ( I know this isnt likely to happen, but im
>> building this to gain knowledge and experience), what would be
>> the best method to handle that many connections via sockets?
> As many people have said, it depends on your OS. Under Linux (and
> other systems conforming to the XPG4-UNIX standard or using GNU
> libc 5.4.28 or above) you would probably want to use the poll()
> syscall, which is the highly optimized form of select mentioned.
epoll() sounded like something different to me. poll() still
requires you pass an array of fd's in every time, which is not
highly optimised to my mind.
> I would strongly suggest that for a MUD you avoid threads, as they
> will hinder you more than help you. I say this because a MUD must
> process things sequentially - you will run into big trouble if you
> allow a character to start combat with another character while
> that other character is partway through moving rooms, for example.
Errrrr - this is what mutexes and similar mechanisms are for. I'd
say MUDs are actually inherently parallel since you have several
players and lots of mobiles all doing things at once (although as
mentioned before, having a thread for each of them is most likely a
MUD-Dev mailing list
MUD-Dev at kanga.nu
More information about the MUD-Dev