News for hackers. Stuff that matters.
Re:Select(2) is fundamentally broken by ensiferum on Friday January 06, 2017 @04:28AM (#13334948)
"It is heavyweight. It requires constantly registering and unregistering processes from the file descriptors, potentially thousands of descriptors, thousands times per second."

Can someone clarify what this tries to say. Thanks.

Re:Select(2) is fundamentally broken by majke on Friday January 06, 2017 @05:30AM (#13335293)
Imagine a kernel has a data structure for each socket. When a process blocks on that socket, a kernel must "register" it on it.

So that - when an event on a socket happens, the kernel instantly knows which processes to wake up. A reverse lookup: given socket, return list of blocking processes.

I'm arguing that maintaining this reverse lookup is a hard work, especially when you need to set it up it and tear it down on every call to select().

Re:Select(2) is fundamentally broken by fstd on Friday January 06, 2017 @06:49AM (#13335602)
Before each call to select, you'll have to FD_ZERO the fd set(s), then individually FD_SET each fd you're interested in.

If that's a large number of fds, then that's quite some overhead.