I am referring to POSIX standard of select and poll system C API calls?
The select()
call has you use a bitmask to mark which sockets and file descriptors you want to watch, and then the operating system marks which ones in fact have had some kind of activity; poll()
has you create a list of descriptor IDs, and the operating system marks each of them with the kind of event that occurred.
Thus with poll()
you do not have to approach each socket that showed activity, and try reading and writing and prodding it to find out what kind of thing has happened to it. Instead, the poll()
data structure tells you ahead of time whether the socket has new data to read, or has more room now to write, or what.
In fact, poll()
has inspired yet another mechanism in modern Linux kernels: epoll()
which improves even more upon the mechanism to allow yet another leap in scalability, as today's servers often want to handle tens of thousands of connections at once. This is a good introduction to the effort:
http://scotdoyle.com/python-epoll-howto.html
While this link has some nice graphs showing the benefits of epoll()
(you will note that select()
is by this point considered so inefficient and old-fashioned that it does not even get a line on these graphs!):
http://lse.sourceforge.net/epoll/index.html
Update: Here is another Stack Overflow question, whose answer gives even more detail about the differences:
http://stackoverflow.com/questions/2032598/caveats-of-select-poll-vs-epoll-reactors-in-twisted