Re: POLL or SELECT

From: Anthony Baxter <[email protected]>
Date: Fri, 14 Feb 1997 09:57:07 +1100

>>> "Andres Kroonmaa" wrote
> > From: Peter Marelas <maral@phase-one.com.au>
> > Im just wondering which I/O multiplexing function most people are using,
> > and on what OS.

> As of I know, Solaris actually in its libraries uses poll, so that
> when you do select(), library parses FD sets and does poll() to OS. If
> I am right, this involves allocating temporary array of pollfd structures,
> setting lots of request data upon call to OS and packing returned data
> back to FD_SET upon return. Quite an overhead. So, seems that using poll
> on Solaris would skip this overhead. But current implementation of
> USE_POLL seems to do that same overhead in squid process. Squid could be

But but but - it skips the FD_SET/FD_ISSET unpack/pack. Using poll is faster
than select on Solaris - it can also go to 4096 filedescriptor. A report I've
had says poll is much faster than select on OSF/1, too.

> Other than that, USE_POLL is used to overcome a limit of 1024 file
> descriptors select() can handle on some OS-es. If you do not need more
> than 1024 open files at a time, i'd suggest to use select() for now.

If your O/S supports poll as a system call, I'd recommend using it.

"go not to squid-users for answers, for they shall say both 'yes' and 'no'" :)
Received on Thu Feb 13 1997 - 15:12:35 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:27 MST