Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 1998 13:08:39 -0700 (PDT)
From:      Marc Slemko <marcs@znep.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: combined accept&read
Message-ID:  <Pine.GSO.4.02A.9808201301340.5631-100000@redfish>
In-Reply-To: <199808201002.MAA26820@labinfo.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.02A.9808201301340.5631-100000>