I wish the UNIXes had gone together and standardized a modern alternative to poll, maybe as part of POSIX. It sucks that any time I want to listen to IO events, I have to choose between old, low performance, cross-platform APIs and the new, higher-performance but Linux-only epoll.
usrnm 1 hours ago [-]
Aren't there enough wrapper libraries for all programming languages that take care of this under the hood? You don't have to rely on libc only
mort96 54 minutes ago [-]
Sure, there are wrapper libraries. But then I'm met with the question: do I add some big heavy handed IO wrapper library, or ... do I just call poll
Galanwe 42 minutes ago [-]
I wouldn't count uv/ev/etc as "big heavy IO wrapper library".
mort96 39 minutes ago [-]
I would, especially when nothing else in the program uses it and you just introduce it for one small thing in place of calling poll(). It's over 40 000 loc, over 70 000 including tests.
ahartmetz 2 hours ago [-]
For sure. Though every platform does have it own high-performance alternative, with only kqueue shared by some less popular ones.
tarruda 30 minutes ago [-]
I have implemented a simple asyncio compatible micro event loop library in python.
The goal was to understand the underlying mechanisms behind python's async/await and to help coworkers understand how event loops work under the hoods.
Good read but I wish it included io_uring as well.
lynx97 2 hours ago [-]
There is no mention of epoll in thsi other then the heading.
lstodd 21 minutes ago [-]
It's because epoll === kqueue mostly.
Besides kqueue grew from FreeBSD, not OSX. Such ignorance saddens me much more.
commandersaki 35 minutes ago [-]
Nice article, though a few spelling mistakes that I thought was to distinguish it from AI slop, only to realise this was written a few years before the AI/GPT craze.
Rendered at 10:33:01 GMT+0000 (Coordinated Universal Time) with Vercel.
The goal was to understand the underlying mechanisms behind python's async/await and to help coworkers understand how event loops work under the hoods.
The end result is somewhat interesting, as unlike traditional event loop libraries, it doesn't use callbacks as the scheduling primitive: https://gist.github.com/tarruda/5b8c19779c8ff4e8100f0b37eb59...
Besides kqueue grew from FreeBSD, not OSX. Such ignorance saddens me much more.