MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: So in an event-driven server, how do you ...
In <199704071758.RAA543716#out2,ibm.net>, on 04/07/97
at 01:39 PM, Michael Hohensee <michael#sparta,mainstream.net> said:
>It looks like you guys hate polling. (Not that I blame you, I don't
>really like it myself. :) But if you've got a system that just sits
>until the next "ripening", how do you do your IO with players? Do
>you use an endless loop to poll the connections? Or do you use the
>SIGIO signal?
Rather than re-state, from an earlier post of mine:
--<cut>--
> I am particularly interested in how your pool of threads manages socket
> connections. Are these threads dynamically created to manage connections?
> That is, do you n+1 threads managing your connections, where n is active
> connections plus one to handle connection requests on the master socket?
> Are sockets blocked or do you use some other method of activating threads?
This is really really crude, as its very long time since I looked at
this code:
One thread watches the master socket and spawns connection sockets
from there as they come in.
The child sockets then go into a pool (actually I think its a bag?)
with
a monitoring thread. Any IO to or from a socket is then assigned on
a
first available basis to a thread from a waiting pool of IO threads.
Should an IO request come in which does not have a waiting thread
ready
to execute it, a new thread is created to process the IO.
Should the number of IO threads significantly exceed the number of
open
sockets, then IO threads are killed down to a base minimum.
As such the total number of IO threads is proportional to the
current
maximum rate of IO transactions thru the system.
I could be way off here, but I think the above is fairly accurate,
well sorta, maybe.
--<cut>--
>I tried to use both. I poll for new commands from the players, and
>use the SIGIO signal to hook up a new connection. More than a
>little bit dirty. It doesn't work under BSD, then I have to poll
>for everything.
Look into the select() and poll() calls for *nix work.
--
J C Lawrence Internet: claw#null,net
(Contractor) Internet: coder#ibm,net
---------------(*) Internet: clawrenc#cup,hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...
- Thread context:
- So in an event-driven server, how do you ...,
Michael Hohensee michael#sparta,mainstream.net, Tue 08 Apr 1997, 00:35 GMT
- <Possible follow-up(s)>
- Re: So in an event-driven server, how do you ...,
S001GMU S001GMU#nova,wright.edu, Tue 08 Apr 1997, 02:10 GMT
- Re: So in an event-driven server, how do you ...,
Nathan Yospe yospe#hawaii,edu, Tue 08 Apr 1997, 03:42 GMT
- Re: So in an event-driven server, how do you ...,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Tue 08 Apr 1997, 13:08 GMT
- Re: So in an event-driven server, how do you ...,
clawrenc clawrenc#xsvr1,cup.hp.com, Sat 12 Apr 1997, 04:31 GMT
- Re: So in an event-driven server, how do you ...,
clawrenc clawrenc#cup,hp.com, Sat 12 Apr 1997, 04:38 GMT
- Re: Resets and repops,
coder coder#ibm,net, Sun 06 Apr 1997, 04:08 GMT
[ Other Periods
| Other mailing lists
| Search
]