[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine
Chris Gray
cg at ami-cg.GraySage.Edmonton.AB.CA
Tue Aug 11 21:23:07 CEST 1998
[J C Lawrence:]
[>> is me]
>> I didn't quite follow all of that, but I'll ask this question: where
>> does your server spend its time waiting if it has nothing to do?
>> Mine spends its time in a single 'select' call, which contains the
>> fd-bits for the main connection socket, and all client sockets. I'm
>> not multi-threaded, so that is easy for me to do.
>
>Did you note the performance concerns of select() vs poll() at:
>
> http://www.kanga.nu/~petidomo/lists/mud-dev/1998Q2/msg01208.html
Yep, I followed that information. I've used 'poll' at work (on Solaris,
I think it was). The problem is that Linux doesn't seem to support 'poll'.
Grrr.
The bright side is that using 'poll' doesn't really help unless you
are multithreaded (which I'm not), since you always have to wait for
input from any of your open client sockets. Since UNIX/Linux re-uses
fd numbers, they will tend to cluster towards the small end of the
values, and hence just keeping track of the maximum one works out not
too badly.
More information about the mud-dev-archive
mailing list