A ton of software complains like twenty times that I need to restart Windows if I don't close certain apps during an installation... Then it works fine and doesn't bother me any more. The only things that usually require restarts are certain Windows Updates.
I presume it's due to the fact that Linux lets files be modified while opened/loaded/being executed. Windows locks them (as they memory map them with a lock)... So Linux can update files without forcing things to stop (though that can break things badly). Windows has to restart to clear all the file locks that the system itself has.
Which is also odd, as NT being a hybrid kernel is far less 'integrated' and monolithic than the monolithic Linux kernel.
Ed: to clarify, Linux generally memory maps executables/libraries as copy-on-write. You can modify/delete executables while they are running, and it won't impact the current execution. However, if you update a shared object with a new one with a new ABI, and a currently - executing program loads it presuming it is the same as before... breaky-breaky-time. Try updating glibc on a Linux system, one library at a time. The entire system will stop functioning at all before you are a third complete. Also, interestingly, file locking is and has been competely broken in Linux.. well, forever. It's always a good idea to memory map files on Linux as copy-on-write for reads so that they don't inexplicably change on you while you are reading them. The kernel may do that for you now internally, though.
So does windows create copies of the modified files and deletes the previous ones on restart? Or just queues the required modifications to be done on next startup?
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.
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 :/).
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.
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.
50
u/Ameisen Feb 07 '19 edited Feb 07 '19
A ton of software complains like twenty times that I need to restart Windows if I don't close certain apps during an installation... Then it works fine and doesn't bother me any more. The only things that usually require restarts are certain Windows Updates.
I presume it's due to the fact that Linux lets files be modified while opened/loaded/being executed. Windows locks them (as they memory map them with a lock)... So Linux can update files without forcing things to stop (though that can break things badly). Windows has to restart to clear all the file locks that the system itself has.
Which is also odd, as NT being a hybrid kernel is far less 'integrated' and monolithic than the monolithic Linux kernel.
Ed: to clarify, Linux generally memory maps executables/libraries as copy-on-write. You can modify/delete executables while they are running, and it won't impact the current execution. However, if you update a shared object with a new one with a new ABI, and a currently - executing program loads it presuming it is the same as before... breaky-breaky-time. Try updating glibc on a Linux system, one library at a time. The entire system will stop functioning at all before you are a third complete. Also, interestingly, file locking is and has been competely broken in Linux.. well, forever. It's always a good idea to memory map files on Linux as copy-on-write for reads so that they don't inexplicably change on you while you are reading them. The kernel may do that for you now internally, though.