Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"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.



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().


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: