Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 1998 21:09:26 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        marcs@znep.com (Marc Slemko)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: combined accept&read
Message-ID:  <199808201909.VAA27709@labinfo.iet.unipi.it>
In-Reply-To: <Pine.GSO.4.02A.9808201301340.5631-100000@redfish> from "Marc Slemko" at Aug 20, 98 01:08:20 pm

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808201909.VAA27709>