From owner-freebsd-hackers Thu Aug 20 13:55:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA22040 for freebsd-hackers-outgoing; Thu, 20 Aug 1998 13:55:19 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id NAA22030 for ; Thu, 20 Aug 1998 13:55:12 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id VAA27709; Thu, 20 Aug 1998 21:09:27 +0200 From: Luigi Rizzo Message-Id: <199808201909.VAA27709@labinfo.iet.unipi.it> Subject: Re: combined accept&read To: marcs@znep.com (Marc Slemko) Date: Thu, 20 Aug 1998 21:09:26 +0200 (MET DST) Cc: hackers@FreeBSD.ORG In-Reply-To: from "Marc Slemko" at Aug 20, 98 01:08:20 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > select() > > accept() > > if (fionread()) > > read() > > I'm guessing that just doing the read() could well be cheaper, especially > since Zeus will have the descriptor in non-blocking mode anyway. It may sure -- i did not know that. > still be just as or more expensive than doing a poll() on many systems ... and i have no idea if poll() requires to scan all the fd's before completing, or it can stop at the first hit -- in any case it seems to me that going straight to the right fd should be faster in all cases. > I'm wondering if you may just miss the data for read often though, and end > up going back to your select() only to break out of it in a very short > time. such races are unavoidable :) cheers luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message