Readit News logoReadit News
ralish commented on A fork() in the road   microsoft.com/en-us/resea... · Posted by u/ralish
sfink · 6 years ago
I read the paper, and they make a lot of good points about fork's warts.

But I really wanted some explanation of why Windows process startup seems to be so heavyweight. Why does anything that spawns lots of little independent processes take so bloody long on Windows?

I'm not saying "lots of processes on Windows is slow, lots of processes on Linux is fast, Windows uses CreateProcess, Linux uses fork, CreateProcess is an alternative to fork/exec, therefore fork/exec is better than any alternative." I can imagine all kinds of reasons for the observed behavior, few of which would prove that fork is a good model. But I still want to know what's going on.

ralish · 6 years ago
I'm a bit rusty on this but from memory the overhead is by and large specific to the Win32 environment. Creating a "raw" process is cheap and fast (as you'd reasonably expect), but there's a lot of additional initialisation that needs to occur for a "fully-fledged" Win32 process before it can start executing.

Beyond the raw Process and Thread kernel objects, which are represented by EPROCESS + KPROCESS and ETHREAD + KTHREAD structures in kernel address space, a Win32 process also needs to have:

- A PEB (Process Environment Block) structure in its user address space

- An associated CSR_PROCESS structure maintained by Csrss (Win32 subsystem user-mode)

- An associated W32PROCESS structure for Win32k (Win32 subsystem kernel-mode)

I'm pretty sure these days the W32PROCESS structure only gets created on-demand with the first creation of a GDI or USER object, so presumably CLI apps don't have to pay that price. But either way, those latter three structures are non-trivial. They are complicated structures and I assume involve a context switch (or several) at least for the Csrss component. At least some steps in the process also involve manipulating global data structures which block other process creation/destruction (Csrss steps only?).

I expect all this Win32 specific stuff largely doesn't apply to e.g. the Linux subsystem, and so creating processes should be much faster. The key takeaway is its all the Win32 stuff that contributes the bulk of the overhead, not the fundamental process or thread primitives themselves.

EDIT: If you want to learn more, Mark Russinovich's Windows Internals has a whole chapter on process creation which I'm sure explains all this.

ralish commented on NirSoft Freeware (2008)   nirsoft.net/about_nirsoft... · Posted by u/valgaze
maxxxxx · 7 years ago
And for some (stupid?) reason they weren't integrated into the OS so a lot of people don't know about them.
ralish · 7 years ago
If they're integrated into the OS they have to be supported at the same level as the rest of the OS, which entails the same rigorous processes w.r.t. updates, bug fixes, etc...

By keeping them out-of-band, that support requirement doesn't apply, allowing the tools to be much more aggressively updated and released without the same degree of oversight. There's a reason they're licensed separately and effectively with no support or warranty. Doing so enables their rapid development without/less-of the usual bureaucracy.

ralish commented on MS Paint is here to stay   blogs.windows.com/windows... · Posted by u/richardboegli
jmkni · 8 years ago
Context menus close when you use the snipping tool.
ralish · 8 years ago
Hence the Delay option.
ralish commented on New Distros Coming to Bash/WSL via Windows Store   blogs.msdn.microsoft.com/... · Posted by u/runesoerensen
quickben · 8 years ago
POSIX is a standard.

Windows has yet to provide a consistent way how to obtain the OS version across releases. Then we can maybe talk about standardizing apps communications.

ralish · 8 years ago
Uh, that may not be the best example. Are you aware of a reliable way to retrieve the OS version across all POSIX OSs? Because if you are, I would love to hear it.
ralish commented on Rumors of Cmd’s death have been greatly exaggerated   blogs.msdn.microsoft.com/... · Posted by u/MikusR
samplatt · 9 years ago
They implemented bash into Windows 10, and their web-ish/app-ish "platform" Silverlight does not work in their own browser in Windows 10 and isn't intended to.

Microsoft have improved leaps and bounds in the last few years but saying that a story is immediately hyperbole because "X-good-technical-reason" isn't something I'm willing to commit to for any large corporation.

ralish · 9 years ago
Sure, but the degree of usage of cmd makes Silverlight's usage look like a hobby project. It's used everywhere, including all over Microsoft's own software. It'd easily be the single biggest backwards incompatible change ever made by Microsoft and would affect software going back to the 1980s. The engineering effort involved to migrate anything that is using cmd is mind boggling, to the extent of being completely infeasible. It's a safe bet that for as long as Windows is around, cmd is going to stay with it.
ralish commented on Rumors of Cmd’s death have been greatly exaggerated   blogs.msdn.microsoft.com/... · Posted by u/MikusR
symlinkk · 9 years ago
I would be interested to know why you are being downvoted.
ralish · 9 years ago
Because it's well known by anyone interested in this area? There's been a barrage of "Windows 10 Telemetry/Privacy" related stories since its release. It's also publicly documented by Microsoft itself: https://technet.microsoft.com/en-au/itpro/windows/manage/con...

"Performance and reliability data, such as which programs are launched on a device, how long they run, how quickly they respond to input, how many problems are experienced with an app or device, and how quickly information is sent or received over a network connection."

ralish commented on Rumors of Cmd’s death have been greatly exaggerated   blogs.msdn.microsoft.com/... · Posted by u/MikusR
sean_patel · 9 years ago
From the Article:

> Notice the nuance here: The above paragraph states that “[PowerShell] replaces Command Prompt (aka, “cmd.exe”) in the WIN + X menu, in File Explorer”s File menu“. It does not say “[PowerShell] replaces Command Prompt“, period! The paragraph even goes on to show you how to quickly launch Cmd, and points out that you can revert this default setting to launch Cmd by default instead if you prefer.

and

> So, to be ultra-clear here: All that’s happening is that, in the [Win] + [X] (“Power User’s menu”), or File Explorer’s File menu, PowerShell is presented instead of Cmd. That’s all! Nothing is being removed, your scripts will continue to run just as they always have, the sky is not falling!

Looks their Release Notes writer did a poor job of explaining this, so all hell broke loose and now they forced the "Commandline" Blog Team to write a blog post screaming in CAPS and with Underlined words and Big Fonts (and even more confusing language and punctuation), to tell everyone - what they really meant to say - in their release notes.

ralish · 9 years ago
Agree that the phrasing could have been a lot clearer, but really, Microsoft removing cmd just doesn't pass even a basic sanity check. I remember seeing the original news articles and just ignoring them as obviously rubbish. It's pretty sad to see so many tech news sites & aggregators just pick-up and run with stories like that which anyone at all knowledgeable about the subject area would immediately know is hyperbole.
ralish commented on Web Bloat Score Calculator   webbloatscore.com... · Posted by u/zdw
ralish · 9 years ago
It's certainly a lean web site. Or rather, the 503 is lean.
ralish commented on High CPU use by taskhost.exe when Windows 8.1 user name contains “user”   support.microsoft.com/en-... · Posted by u/ivank
Animats · 9 years ago
And that's Microsoft saying this, officially. It's not some comment on Stack Overflow.

So does DFPCommon.dl do, anyway? Does it have something to do with "telemetry", the built-in spyware in Windows 10?

ralish · 9 years ago
It appears to be a support library for dfp.exe, which is the "Disk Footprint Tool". I never knew it existed until now, but it seems to be a potentially quite handy utility with a purpose similar to tools like WinDirStat (but CLI only?).

So to answer your question, no, it's not part of the telemetry infrastructure. And I'll add that calling that infrastructure "spyware" is a simplistic analysis of what's a complex issue. I say that as someone who goes to great pains to turn off as much telemetry as I can across almost all applications I use.

u/ralish

KarmaCake day253July 14, 2012View Original