News for hackers. Stuff that matters.
Re:Using select(2) the right way by peterwwillis on Monday June 05, 2017 @01:30AM (#14485431)
So in other words, when is it appropriate to avoid using a pre-coded, pre-tested, independently-supported, documented, stable set of code designed to work in a variety of situations as well as it can? When it's not designed for what you need it to do. But i/o libraries are designed for all cases of select() I can think of.

The only time you shouldn't use a library, then, is when it literally doesn't work for you. In that case you should modify the library to add support for what you need, get it upstream, and use the library. Even if you decide using a library isn't right for you, you should at least read the source code of a library to see how they would have done it.

Re:Using select(2) the right way by linkregister on Monday June 05, 2017 @01:48AM (#14485480)
You're right with this comment. There have been times when I would have benefitted by looking at a library's code even when it didn't fit what I was trying to do.

What libraries do you recommend to replace async io system calls in C?

Re:Using select(2) the right way by loeg on Monday June 05, 2017 @02:09AM (#14485555)
The libevent family of libraries -- libevent, libev, libuv.
Re:Using select(2) the right way by pbat on Monday June 05, 2017 @01:55AM (#14485506)
check out libev: http://software.schmorp.de/pkg/libev.html

scales well, has a decent API.