MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: MUD Coding in general.
Nathan Fenenga Yospe (yospe#Hawaii,Edu) wrote:
: Thread Player Socket:
: Start
: Wait for Connect
: Pick up
: Spawn new thread for next connect
: loop
: when input, load to buffer
: when output, flush (provision for delayed flush here)
: end
: (This thread sends message and terminates when the main process dies)
Have you looked at using an asynchronous model for handling your
connection threads? Allocating one thread per connection can get
expensive when the total number of connections gets large (say 500
simultaneous players).
I have a thread pool here that as a unit manages the IO from a much
larger set of connections. Essentially all the threads block until
there is IO to serve. Threads are assigned to IO on a first-available
basis, and then de-assigned as soon as the IO is compleated. This
allows (in very crude tests) a rough ratio of 1:20 threads per active
socket while still maintaining good response rates (you could also put
in a balancing algorithm which grows/shrinks the thread pool in
response to loading).
--
J C Lawrence Internet: coder#ibm,net
---------------(*) Internet: clawrenc#cup,hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...
- Thread context:
- Re: command parsing, (continued)
- Re: MUD Design Digest V1 #52,
Chris Lawrence clawrenc#xsvr1,cup.hp.com, Fri 22 Nov 1996, 21:34 GMT
- Re: MUD Design Digest V1 #49,
Chris Lawrence clawrenc#xsvr1,cup.hp.com, Fri 22 Nov 1996, 21:22 GMT
- Re: MUD Design Digest V1 #47,
Chris Lawrence clawrenc#xsvr1,cup.hp.com, Fri 22 Nov 1996, 21:20 GMT
- Re: MUD Coding in general.,
Chris Lawrence clawrenc#xsvr1,cup.hp.com, Thu 21 Nov 1996, 18:54 GMT
- Re: MUD Design Digest V1 #55,
Chris Gray cg#ami-cg,graysage.edmonton.ab.ca, Tue 19 Nov 1996, 06:50 GMT
[ Other Periods
| Other mailing lists
| Search
]