3 ms·
"The good news is that Windows also has a completion based system similar to io_uring but without batching, called IOCP" fwiw IOCP in NT predates the similar m
by dboreham 4y ago
"The good news is that Windows also has a completion based system similar to io_uring but without batching, called IOCP"
fwiw IOCP in NT predates the similar mechanisms in Linux by at least a decade (and the VMS QIO scheme upon which it was in turn based is even older). As I understand it the reason Unix(1) (and then Linux) did not have efficient network I/O kernel interfaces until relatively recently was due to fear of patent litigation from MS.
(1) except for AIX, possibly due to IBM being less concerned about MS patents in this area.
- dataflow 4y agoWindows has I/O rings now too. https://learn.microsoft.com/en-us/windows/win32/api/ioringapi/ https://learn.microsoft.com/en-us/windows/win32/api/ioringap...
- amluto 4y agoIOCP was missing a rather obvious feature until recently: disassociating a handle from an IOCP: https://stackoverflow.com/questions/30688028/un-associate-socket-from-completion-port/35373536#35373536 https://stackoverflow.com/questions/30688028/un-associate-so...
- magicalhippo 4y agoJust curious, what's the use-case for this?
- amluto 4y agoAny library that is supposed to leave a socket or other handle in the same state in which it got it.
- magicalhippo 4y agoYeah I suppose. Not used to such libraries, the ones I've used either control the creation of the handle or take ownership.
- p_l 4y agoTL;DR - Async I/O wasn't included in Unices because it's hard & complex and unices are about keeping to the simple till you can no longer lie about it being painless. Considering that Windows NT's IOCP is very close to direct copy of VMS QIO mechanism (and even more underneath in officially undocumented boundary layer between user space and kernel space), I don't think it's a case of patents. UNIX was just always against asynchronous I/O, back from the start - asynchronous I/O schemes were known and used as early as original UNIX, and going with fully synchronous model was explicit design choice at Bell Labs. When asynchronous I/O turned out to be important enough to include after all, there was no common enough interface to handle it and everyone was using select() and poll() out of lack of anything better for the most obvious use cases of AIO (networking). Meanwhile properly implementing asynchronous I/O can be non-trivial - QIO never ran truly multithreaded from the PoV of client program, for example (NT focused on making sure async worked from start).
- tiffanyh 4y ago> Considering that Windows NT's IOCP is very close to direct copy of VMS QIO mechanism Microsoft hired the main architect of VMS, Dave Cutler, away from DEC to design Windows NT - so this shouldn’t be a surprise. https://news.ycombinator.com/item?id=32602132 https://news.ycombinator.com/item?id=32602132
- p_l 4y agoNot only that, Cutler went to MS essentially with a team and a project (that didn't get accepted at Digital) to redo VMS from scratch using same principles but with new experience and in cleaner way.
- dboreham 4y agoMS fought a legal battle with Dec over Cutler's move. Supposedly that ended up settled such that MS had license to Dec patents and explains why NT resembles VMS yet no lawsuit from Dec. Meanwhile other Unix vendors did not have said license. Fwiw I heard this story directly from Unix vendors OS devs when I worked at Netscape on servers (that supported IOCP on NT and hence often performed much better on a low end PC vs high end Unix iron). https://techmonitor.ai/technology/dec_forced_microsoft_into_alliance_with_legal_threat https://techmonitor.ai/technology/dec_forced_microsoft_into_...