2.3 KiB
← Back to Twitter thread index
title: "Quick summary of why not {pselect, ppoll, epoll_pwait2} style non-TCP IO [it can" author: "NOTimothyLottes" handle: "@NOTimothyLottes" post_url: "https://x.com/NOTimothyLottes/status/2070337342854832468" post_id: "2070337342854832468" timestamp: "2026-06-26 02:44:22" post_count: 8 reply_count: 2 repost_count: 1 like_count: 16 view_count: 2149
@NOTimothyLottes — Quick summary of why not {pselect, ppoll, epoll_pwait2} style non-TCP IO [it can
Post 1 (2026-06-26 02:44:22)
Quick summary of why not {pselect, ppoll, epoll_pwait2} style non-TCP IO [it can amplify kernel transitions]. For UDP stuff blocking {sendmmsg,recvmmsg (with timeout)} amortizes out kernel transitions.
Post 2 (2026-06-26 02:48:15) — reply to Post 1
sendmmsg/recvmmsg can only work with 1024 packets at a time unfortunately. You’ve gotta loop them. While they’re surprisingly fairly deterministic in execution times, their throughput isn’t the best. The Linux kernel takes far longer to process sending the packets out than my own code does to process the sim and build the packets in the first place lol.
Post 3 (2026-06-26 03:07:37) — reply to Post 2
@AgileJebrim Yes 1024 max, so best case 1/1024 the syscall count (well factored). As for overhead, for a co-located server you could always hijack the network card driver and just move your server into it and run kernel side if you really wanted to.
Post 4 (2026-06-26 03:08:39) — reply to Post 3
@NOTimothyLottes If you want to be locked in to a particular NIC yeah.
Post 5 (2026-06-26 07:28:39) — reply to Post 4
@AgileJebrim @NOTimothyLottes You can use eBPF as a poor man's kernel bypass.
Post 6 (2026-06-26 07:38:00) — reply to Post 1
@NOTimothyLottes Take a look at http://lalists.stanford.edu/lad/2001/Nov/0248.html
Post 7 (2026-06-26 10:58:14) — reply to Post 5
@aepau2 @AgileJebrim Not that any of my source would pass their nanny tester. When I was younger and running my own business, I used to host my business website off of a really old laptop running an in-kernel web server that I wrote. It wasn’t that hard to do long ago.
Post 8 (2026-06-26 11:45:37) — reply to Post 7
@NOTimothyLottes @aepau2 eBPF doesn’t support SIMD lol
