View Single Post
  #7 (permalink)  
Old January 16th, 2002
Tamama Tamama is offline
Enthusiast
 
Join Date: January 1st, 2002
Posts: 34
Tamama is flying high
Lightbulb oh?

Both poll() and select() take a list with file descriptors. One could implement poll() with select(), and select() with poll() and the program wouldn't even know.

However, poll() doesnt have to clear the set, doesnt have to possibly look in 3 sets for 1 socket, and doesnt have to create 3 new sets to return.

With this knowledge, poll() would be faster.

BSD manpage extract:

COMPATIBILITY

This implementation differs from the historical one in that a given file descriptor may not cause poll() to return with an error. In cases where this would have happened in the historical implementation (e.g. trying to poll a revoke(2)ed descriptor), this implementation instead copies the events bitmask to the revents bitmask. Attempting to perform I/O on this descriptor will then return an error. This behaviour is believed to be more useful.

So there you have it.


I dont use neither of them :P

Tam
Reply With Quote