Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!ucbcad!ucbvax!DECWRL.DEC.COM!susan From: susan@DECWRL.DEC.COM (Susan Angebranndt) Newsgroups: comp.windows.x Subject: Re: X V11 R1 Questions Message-ID: <8711091935.AA04177@gilroy.dec.com> Date: Mon, 9-Nov-87 18:00:17 EST Article-I.D.: gilroy.8711091935.AA04177 Posted: Mon Nov 9 18:00:17 1987 Date-Received: Wed, 11-Nov-87 20:07:30 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 38 sequent!gssc!bog@decwrl (Lee Boekelheide) writes: In the sample server, there is (in the 4.2bsd version) a complication between Dispatch, WaitForSomething and ReadRequestFromClient that favors servicing requests from clients that have complete requests in the buffers read by ReadRequestFromClient. This favoritism, induced through the flag variable ClientsWithInput, ignores clients that have no full requests in their buffers until all requests are serviced for those clients that have complete requests. The flag ClientsWithInput is there so that the sample server can avoid doing 'select()' at all costs. Even a non-blocking select() to find out which clients have data pending is a heavy-weight operation. The fairest (and simplest) algorithm we could come up with that avoided select calls was to process all complete requests from each select before doing the next select call. (We don't allow clients with incomplete requests to be processed so that client doesn't monopolize the server.) The results are okay with this scheme. Running 2 plaids on my microvax, I can still type at an xterm and get a good response. Is it perhaps that the 4.2bsd ReadRequestFromClient function never reads in a single read() more than a packet as written by the client? No, like your System V implementation, ReadRequestFromClient reads in as much as possible. If your implementation of select() for System V isn't as costly as the 4.2 implementation, then you can alter the scheduler to check for pending data more often. Susan