From: randyhyde on


Jim Carlock wrote:
> <randyhyde(a)earthlink.net> wrote:
> > What you really want is a distributed application. You'd need only
> > two threads on any given machine, the main thread (playing the
> > game for the particular user) and the thread that communicates
> > with the other machines on the network.
>
> I only see the need for one thread on the client side. The server
> will need to be worked in some other way though, one thread
> per connection?

If you do client/server, as opposed to peer to peer, yes.

>
> So I'm thinking that only one thread is needed even on a server,
> provided the server processor and the network is fast enough to
> handle all the connections?

Having not written such a game myself, I'm not in a position to
determine if it could be done this way or not. OTOH, text adventure
games don't exactly tax the CPU, so it's probably quite possible that
you could support hundreds of users on one game and still use less
computing power than a modern first-person shooter.
Cheers,
Randy Hyde