4 ms·
For ages in *nixland the phrase "select is not broken" has been an aphorism for such situations. I'm not sure of its origin, but it's referenced in The Pragmat
by pengaru 3y ago
For ages in *nixland the phrase "select is not broken" has been an aphorism for such situations. I'm not sure of its origin, but it's referenced in The Pragmatic Programmer:
> Tip #33, pg. 95:
>
> “select” Isn't Broken
>
> It is rare to find a bug in the OS or the compiler, or even a third-party
> product or library. The bug is most likely in the application.
- AshamedCaptain 3y agoI really don't know when this became "common knowledge". Most OSes and compilers were utter crap not more than 10-20 years ago. We would spend afternoons ranting about MSVC++ bugs. gcc was a joke, and even if quickly improved, does nobody really remember that by the 2010's gcc was so buggy -O3 was barely usable? No Gentoo users around?
- RetroTechie 3y agoI recall doing some Gentoo installs using -Os at least for some packages, just to see how much that would shrink binary sizes. Documentation / wikis etc. advised against that not just for performance-of-generated-code reasons, but also because of compiler bugs using -Os was considered unreliable. Note this was with ancient GCC (v2.9.x, early 3.x releases iirc)
- paulddraper 3y ago`-O3` was known/documented to be unsafe.
- toast0 3y agoYeah, I don't know where that comes from. Everything is broken. If you think select is broken, read the docs and make sure you're using it correctly. If you still think select isn't doing what the docs say, try to reduce your actual use into a minimal test case and see. Go look at the source for select on your OS. Search the internet and see if anyone else ran into the same thing (but be careful, because there's lots of bad leads out there).
- syncsynchalt 3y agoIronically we later found that `select` is broken by design. `poll` was created as an improvement, and syscalls like `epoll` later refined it further.
- pengaru 3y agoFD_SETSIZE ought to be enough for anybody