Re: Socket engines

From: Jorgen Sigvardsson (di5sig@CSE.HKS.SE)
Date: 09/02/97


Daniel Koepke wrote:

> On Fri, 29 Aug 1997, Brian Gray wrote:
>
> -+Has anyone here ever tried to rewrite the core socket engine?  I've
> been
> -+doing a bit of research and was wondering if the current system of
> -+select()'ing through the descriptor list is the best way to go.  Has
>
> -+anyone tried SIGIO?  What about fork()'ing a separate process for
> each
> -+descriptor and using normal UNIX IPC to communicate?  Anyone ever
> set up
> -+pseudo terminals?  I'd love to get the actual sockets working
> -+transparently, meaning output to stdout goes to the socket and stdin
>
> -+reads from the socket.  Of course stderr would always point out to
> the logs.
>
> select() is, in general, the best way short of multi-threading. fork()
>
> uses too much system resources; and select() remains fairly simple,
> straight-forward, and multi-functional. As for SIGIO, I haven't done
> an indepth study on the matter, but it still seems as though select()
> is more portable and straight-forward.
>

select() is the way to do it as you say Daniel. Hearing the suggestion
of using
fork() makes me want to shiver.. what would happen if 100+ players are
online?
Wooops.. You'd get an astronomical load.. + a fork() makes a complete
copy of
the mother process, which gives us 100+ muds running.. at the same time
on the
same machine! Is there a port for a Cray super computer?

SIGIO is a way to do it when you are running a very small process.. lets
say a
talk-program (UNIX talk). Whenever something arrives on the socket
(filedescriptor
in general), the kernel will generate a signal and call the appropriate
callback.
That is not a very good idea in a mud since all transmissions from the
players
will interrupt the mud (the SIGIO callback is called). Even if we lived
in a world
without malicious morons that just loves to sit there and tap enter all
the time
it wouldn't work. The mud would spend more time accepting new
transmissions than
doing some actual work (updating fights, resetting zones etc). A
talkprogram would
be able to handle this with ease since two humans can't type very fast..

My 2 cents

// jorgen


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST