4 ms·
This is a really interesting article, and WSL 1 was a testament to Dave Cutler's vision for the NT architecture re: support for multiple operating environments
by trilinearnz 6y ago
This is a really interesting article, and WSL 1 was a testament to Dave Cutler's vision for the NT architecture re: support for multiple operating environments (read 'Showstopper!' for more background).
Also, as someone hacking with a custom OS kernel in their spare time, I found this quote illuminating when it comes to understanding the lower level:
> A user-space process is a collection of binary instructions that the processor executes uninterruptedly (leaving interrupts aside). The operating system’s kernel is unaware of what the process is doing until the process issues a system call: at that point, the kernel regains control to perform an operation on behalf of the user, which can be something like reading a file or pausing for a few seconds.
[Edit: My first point is actually incorrect - see child comment about 'pico processes']
- TimTheTinker 6y agoThat leaves out the fact that the kernel scheduler does in fact issue timed interrupts to all kernel and userspace code running on a given core, except for "critical sections" (where one or more locks are held). That being said, the scheduler is so reliable and so seamless that one need hardly ever worry about it unless a particular block of code must not be interrupted, usually for parts of parallel/multithreaded code that have shared memory or other resources, or sections within the kernel or scheduler itself. More info on the current Linux scheduler here: https://www.kernel.org/doc/html/latest/scheduler/sched-design-CFS.html https://www.kernel.org/doc/html/latest/scheduler/sched-desig... Check out the code here, if you're brave: https://github.com/torvalds/linux/blob/master/kernel/sched/fair.c https://github.com/torvalds/linux/blob/master/kernel/sched/f...
- shawnz 6y agoWSL 1 actually doesn't use the NT subsystem architecture like SFU/Interix did (and this article implies). Instead WSL 1 was implemented with a relatively new feature called "pico processes". See: https://docs.microsoft.com/en-us/archive/blogs/wsl/pico-process-overview https://docs.microsoft.com/en-us/archive/blogs/wsl/pico-proc...
- sundvor 6y agoShowstopper! was an excellent book. I found a new appreciation for dogfood after that.
- mixmastamyk 6y agoIt's a shame the author didn't mention the original POSIX and OS2 subsystems. I guess the idea didn't pan out and contributes to poor performance.
- skissane 6y agoThe OS/2 subsystem only ever emulated OS/2 1.x, it never emulated OS/2 2.x or later. That severely limited its usefulness. Also, it only supported text mode apps out of the box, and the GUI was only available from Microsoft as an add-on sold separately (which very few people bought) There was never a huge amount of OS/2 software anyway. And a lot of what software was available for OS/2, also had native Windows versions, so why bother emulating the OS/2 version when you can just switch to the native app? A lot of people ran OS/2 1.x because it was the basis of Microsoft's networking solution, Microsoft LAN Manager – which as well as being sold by Microsoft, was also sold in OEM versions from IBM, HP, 3Com, among others. But rather than trying to run OS/2-based LAN Manager under NT, people used NT's native implementation of the LAN Manager protocols (SMB File & Print) I think the POSIX subsystem could have been a lot more successful if Microsoft had invested in it more. But I think Microsoft was worried about investing in it too much, because if UNIX software can run on Windows, a lot of developers might just write UNIX software only, not write to the native Win32 API, and then there would be less switching costs to move that software off Windows and on to UNIX or Linux. What is different about WSL, is that by now POSIX has clearly won the battle for developer mindshare, and Microsoft has decided their best interests are to cooperate with it fully rather than continue in their prior hesitancy about it. But they've had 20+ years to watch it win in the market, and that's informed their change of heart.
- pjmlp 6y agoI only cared about Linux, because of the way Microsoft managed their POSIX support. From my point of view, Linux would never taken off if POSIX had been taken more seriously. I do disagree with the developer mindshare though, for me they are looking into the market for cloud, where yes UNIX was won, but there are plenty of scenarios out there where UNIX support is meaningless, desktop applications, mobile platforms, IoT, mainframes. Then they saw an opportunity to bring back into Windows those developers that are buying Apple laptops for shiny UNIX experience, not connect at all with Apple's culture and now looking to move elsewhere. Personally I am yet to care about using WSL, in any of its variants, all my programming tools are anyway mostly OS agnostic, and the ones that aren't are focused on Windows deployment scenarios anyway.