|
|
|
|
|
by moises_silva
1856 days ago
|
|
> No new code should be using select(). Using it assumes the execution environment keeps all file descriptor values within FD_SETSIZE. I'm with you here. I'm also guilty of using it still for some CLI tools or other small programs. Just to be clear you don't need to assume all fd values will stay within FD_SETSIZE. Just that the fds you will use with select will stay in that range. Even if there will be lots of fds (more than FD_SETSIZE) for other resources, it works for example to select on stdin if you're not doing funny business reopening it. There's no much of an excuse to keep using it though other than laziness. |
|
Edit: I'm biased by Python which has `select.poll` with API similar to epoll and it's really hard to use it instead of select.