2 ms·
> what would be the point of the kernel not using a single function for "get me an available fd" everywhere that it needs one? Multithreading. To return lowes
by Const-me 9y ago
> what would be the point of the kernel not using a single function for "get me an available fd" everywhere that it needs one?
Multithreading.
To return lowest-numbered file descriptor, calls to that single function need to be serialized. On multi-core, and especially on NUMA, I can see how that might hit the performance.
Apps don’t normally create thousands of files, or pipes, or client sockets per second. However, for some server software, accepting thousands of sockets per second is normal.
Update, see also multi-queue NICs: https://www.kernel.org/doc/Documentation/networking/scaling.txt https://www.kernel.org/doc/Documentation/networking/scaling....