r/programming • • Feb 06 '19

Visual Studio Code: January 2019 (version 1.31)

https://code.visualstudio.com/updates/v1_31
790 Upvotes

340 comments sorted by

View all comments

Show parent comments

5

u/Ameisen Feb 07 '19

It reboots into a mode where nothing is really loaded, and then installs as the files aren't locked.

For something that would still be locked, like the kernel, I presume they mark some flag as "needs update", and ntldr probably copies it.

Technically, I also have no doubt that the kernel is capable of memory mapping a file without a lock, so they may take advantage of that as well.

The NT kernel even has fork, iirc. It's just not exposed directly as a system call.

2

u/caspper69 Feb 07 '19 edited Feb 08 '19

Yes, NT has a fork analogue- calling ntCreateProcess with a null executable handle forks the calling process. The problem is the forked process loses its handles to Win32, which does not support fork. So, WSL, for example, can use the fork functionality provided by the NT kernel, but a regular Win32 application cannot.

Edited later to add: win32 likely has no concept of forking a process because Win95/98/ME did not support such a system call, neither did the windows/dos iterations prior.

2

u/cat_in_the_wall Feb 08 '19

wsl is super interesting. its rad that as far as nt is concerned, wsl is an equal citizen to win32: just subsystems.

2

u/caspper69 Feb 08 '19

Honestly, it goes to show the foresight and engineering that went into NT. There's not a ton of love for MS, with the rise of Linux, but the NT kernel has proven to be pretty flexible (many arch, many subsystem support). I'd like to think if they can get a handle on the filesystem problems (which are an absolute albatross all the way around right now), it'll still be holding up remarkably well. Especially considering its development began 30 years ago (wow :/).

2

u/cat_in_the_wall Feb 08 '19

i suspect part of it has to do with timing. I'm sure you're aware of the history of nt (and if not, it's a fascinating rabbit hole to go down), but at that time the landscape was still shifting sands. so the requirement was there from the get-go to build something extremely flexible. those folks came up with some extremely durable software.

2

u/Ameisen Feb 08 '19

It's not as though NTFS is particularly terrible, either.

As I recall, one of the biggest causes of filesystem performance problems on NTFS is the same thing people point out is better than on Linux - the permission systems. When a file has trivial permissions like on Unix, access is trivial. When you have full, potentially inheriting ACLs like NTFS... you may have to do quite a bit of traversal before the VFS determines that you have access.

1

u/caspper69 Feb 08 '19

The other problem is the filter drivers (for antivirus, backup, etc.).

1

u/Limelight_019283 Feb 07 '19

I see, thanks a lot for the info!