[MUD-Dev] Sockets

Ross Nicoll rnicoll at lostics.demon.co.uk
Thu May 13 15:17:30 CEST 1999


"Jon A. Lambert" wrote:

> The common select/poll loop for non-blocking sockets that processes
> incoming, exceptions, reads, writes, and other mud processes is not
> very efficient.  Firstly setting up the parameters to select and checking
> the FD_SETs involved alone is probably higher overhead than threading.
Interesting theory. My MUD server sets every socket in the input set
automatically, and instead of setting them manually every time, it keeps a
pre-setup version, which it just memcpy()s from.

Output set is altered as data is ready to be sent, and has been sent.

Now, assuming that select() works in a nice sensible way, using
interrupts, basically. The OS should receive data for a socket, find the
right program, check if the program is waiting for the data (one
FD_ISSET() call there), and act accordingly.

Threaded may save you the time involved in checking if a certain bit is
set or not, but I really somehow doubt that the overhead in threading
won't be longer than that.



_______________________________________________
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