3 ms·
TL;DR: we use it because then you don't have to write your own. The real question is why it's slow. The answer to that, according to someone they quoted, is tha
by lucb1e 10y ago
TL;DR: we use it because then you don't have to write your own. The real question is why it's slow. The answer to that, according to someone they quoted, is that if you write your own TCP stack, it's inside your application and less stuff has to be copied and switched around (no overhead from receiving in the kernel and then having to pass it on). So it's not that the kernel's implementation is shitty, it's that you'd have to write your own for every application if you wanted to improve it substantially.
- greggman 10y agoGiven your comment and the one about having written a stack from scratch twice and regretting it wouldn't in then be a good idea to use just the kernel's battle hardened code but in user space? At most try to upstream some patches so the same code and be used in userspace. All the benefits (well used code) and none of the drawbacks (context switching). Or am I'm hopelessly naive?
- nulltype 10y agoI think you can do the with the NetBSD rump kernel
- zzzcpan 10y ago> it's not that the kernel's implementation is shitty It's not shitty, but it's full of locks and no batching, so it's definitely not suited for modern CPUs. https://lwn.net/Articles/629155/ https://lwn.net/Articles/629155/