Yesterday I was complaining about IO Completion Ports, and I mentioned that I wasn’t aware of any UNIXy equivalent. I didn’t look very hard — I’ve had a few emails linking me to several sources (nice to know people actually read this stuff!) It seems the UNIX world is a bit fragmented in how it achieves high performance networking:
On Linux 2.6 there’s epoll and kevent. There’s also a proposal by Ulrich Drepper for a new network interface.
On older versions of Linux (Linuces?) you might consider using Realtime signals.
On FreeBSD and NetBSD there’s kqueue.
Additionally, it’s possible to use standard signals or asynchronous I/O to acheive similar results. I’ve always found signals to be unwieldy and cumbersome, so I wouldn’t recommend these.
The main source of this information is this handy web page that describes various ways of getting good network performance on UNIX systems.
Matt Godbolt is a C++ developer living in Chicago. Follow him on Mastodon or Bluesky.