saprykin / plibsys

Highly portable C system library: threads and synchronization primitives, sockets (TCP, UDP, SCTP), IPv4 and IPv6, IPC, hash functions (MD5, SHA-1, SHA-2, SHA-3, GOST), binary trees (RB, AVL) and more. Native code performance.
MIT License
672 stars 74 forks source link

Consider supporting a `select()` equivalent #79

Open merberich-axonvr opened 5 years ago

merberich-axonvr commented 5 years ago

Even when dealing with non-blocking sockets, it is advantageous to be able to check if a function would block or return P_ERROR_IO_WOULD_BLOCK. If a select() variant is unavailable, the alternative is to poll each IO function on each socket manually, which adds overhead to applications when they could be leveraging knowledge that the kernel already has.