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 ...
- To: Multiple Recipients of MUD Design Mailing List <mud-dev#null,net>
- Subject: Re: So in an event-driven server, how do you ...
- From: Nathan Yospe <yospe#hawaii,edu>
- Date: Mon, 7 Apr 1997 10:42:02 -1000
On Mon, 7 Apr 1997, Michael Hohensee wrote:
:
: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?
I'm not sure about the others, but I have a thread for each connection,
set to wait for the condition buffer.notEmpty(). It begins char peeking on
the buffer with the first character... if the input is an instant
(control, or editor, or such) it wakes up and starts processing. If not,
it sets itself to wait for the condition buffer.lineReturned(), and grabs
all completed lines, sending them off to appropriate destinations. One of
these destinations is the Character interpreter, which instantly
interprets and drops on the local queue. (running off of the socket
thread, not the queue's thread) The queue grabs all of these at its own
leisure (meaning the moment it has a free cycle.)
: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.
I'm not sure about BSD, but I think there is a pThreads port for it, and
letting the threads handle polling of that sort is a lot more efficient
and effective, in my experience. I'm not sure how the implementation of
BSD would do it, but most thread implementations support low profile
polling in their wait() implementations.
:Michael Hohensee
:--
:Eagleson's Law:
: Any code of your own that you haven't looked at for six or more
:months, might as well have been written by someone else. (Eagleson is
:an optimist, the real number is more like three weeks.)
*chuckle* He's right. I'm trying to pick apart some code I wrote three
years ago. What _is_ this stuff, and who wrote it, so I can track him down
and _shoot_ him.
__ _ __ _ _ , , , ,
/_ / / ) /_ /_) / ) /| /| / /\ First Light of a Nova Dawn
/ / / \ /_ /_) / \ /-|/ |/ /_/ Final Night of a World Gone
Nathan F. Yospe - University of Hawaii Dept of Physics - yospe#hawaii,edu
- Thread context:
- Re: Yet Another Introduction, (continued)
- Off on the languages tangent!,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Tue 08 Apr 1997, 13:07 GMT
- 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
]