← BYTES
Unix IPC·Starter·Ref: 15.1.43

How does poll() differ from select() in basic usage?

Have a question about this video? Mention reference 15.1.43 when you contact us.

   select():  fd_set (fixed-size bitmask) -- hard limit on how many fds
   poll():    array of pollfd (grows as needed) -- no fixed limit
a.poll() cannot be used with sockets, only with regular files
b.poll() can only watch exactly one file descriptor at a time
c.poll() takes a flexible array of structures (one per file descriptor of interest) instead of select()'s fixed-size bitmask, removing the older hard limit on how many descriptors can be watched at once
d.poll() and select() are two names for the exact same system call with no actual differences
poll() does the same basic job as select() -- wait for readiness across a set of file descriptors -- but represents that set as a dynamically-sized array of pollfd structures rather than select()'s fixed-size bitmask, avoiding the older FD_SETSIZE ceiling select() is bound by.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES15143#UnixIPC