From owner-freebsd-hackers Thu Aug 20 13:10:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA15162 for freebsd-hackers-outgoing; Thu, 20 Aug 1998 13:10:36 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from redfish.go2net.com (redfish.go2net.com [207.178.55.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id NAA15148 for ; Thu, 20 Aug 1998 13:10:34 -0700 (PDT) (envelope-from marcs@go2net.com) Received: from marcs by redfish.go2net.com with smtp (Exim 1.82 #2) id 0z9b0h-00020r-00; Thu, 20 Aug 1998 13:08:39 -0700 Date: Thu, 20 Aug 1998 13:08:39 -0700 (PDT) From: Marc Slemko X-Sender: marcs@redfish To: Luigi Rizzo cc: hackers@FreeBSD.ORG Subject: Re: combined accept&read In-Reply-To: <199808201002.MAA26820@labinfo.iet.unipi.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 20 Aug 1998, Luigi Rizzo wrote: > > > "accept&read combined call is something else we're toying with. Very > > > often we get a poll/select broken because there's data coming in on a > > > socket, and most of the time there's already data in the socket > > > buffers. Being able to do the accept() and read() in a single call > > > should be beneifital." > > it is not very clear to me what the above means -- perhaps that in the > sequence > > select() > accept() > select() > read() > > the second select could be saved ? In that case, one could always write Yes. > > 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 still be just as or more expensive than doing a poll() on many systems though, if you don't have data available at that point most of the time. 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. The overhead from an extra syscall _can_ be very significant on some OSes and hardware. Oh, the other thing that will give a win with Zeus is using poll(), but that is already in -current. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message