On Mon, 2008-02-25 at 15:03 +0100, Henning Rogge wrote:
> Am Sonntag 24 Februar 2008 13:09:09 schrieb Bernd Petrovitsch:
> > BTW the select(2) sys-call is dying out and now sometimes just a wrapper
> > (e.g. in the GNU-libc) function of poll(2). So I don't think that
> > investing time and complexity in a micro-optimization of a select(2)
> > call simply doesn't pay off.
> Do you have a source for this ? I would be interested in reading more about 
> this, because I always thought about "select" as a "non-busy-waiting" 
> function.

It is - don't get confused by the names of the syscalls (which were
chosen ages ago by God knows who).
Both of select(2) and poll(2) are non-busy-waiting functions (if you see
from the userspace) and do basically the same for the same purpose. The
difference is in the parameters passed:
- select(2) wants 3 bitmaps for the filedescriptors and a timeout
parameter. And select(2) may modify all 4 of them - which implies that
you have to create them from scratch before you call select.
- poll(2) has different fields for input and output values for the file
descriptors and a timeout parameter so the total recreation is not
necessary.

Of course you can really poll if you put "0" as timeout there.

BTW the same holds for pselect(2) and ppoll(2).

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




