Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Windows is a thread based OS, not process based, hence why the focus on thread performance, not on process creation.

Which, somewhat ironically, leads NT to have worse numbers in the create thread test than linux in the create process one (25.6us vs 18us).

The redeeming factor of NT is their async IO model which afaik is the best among mainstream OS.



IOCP is very complicated to code against, though. kqueue can do nearly all the same things and is both much cleaner and more portable.


It's a very different paradigm to wrap your head around, but once you grok the NT kernel's approach to I/O (packet based IRPs, inherently asynchronous, thread-agnostic), and thread scheduling, I/O completion ports are very powerful constructs.

The key difference is that I/O completion ports can be used to achieve asynchronous I/O on any underlying object, e.g. files and sockets, and they have this nifty built-in concept of concurrency, such that the kernel can ensure there is always one running thread per CPU core (which is optimal from a scheduling perspective).

You can't use file descriptors with epoll/kqueue, and you certainly can't say "ensure every core only has one active thread running".

"The key to understanding what makes asynchronous I/O in Windows special is...": https://speakerdeck.com/trent/pyparallel-how-we-removed-the-...

"Thread-agnostic I/O with IOCP": https://speakerdeck.com/trent/pyparallel-how-we-removed-the-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: