Aussie living in the San Francisco Bay Area.
Coding since 1998.
.NET Foundation member. C# fan
https://d.sb/
Mastodon: @dan@d.sb

  • 0 Posts
  • 4 Comments
Joined 3 years ago
cake
Cake day: June 14th, 2023

help-circle


  • Different philosophies.

    On Linux, you can delete a running application and it’s fine, because files aren’t actually deleted until the last process that has it open closes it. This applies for all files, not just executables.

    Internally, files are mainly identified by an inode rather than the file path. If you delete a file then create a new one with the same name, the new file will have a different inode number to the old file. Anything that had the file open will still have a valid reference to the old file. If you’re running a program and upgrade it while it’s running, the currently running version will still be using the old inode, while any new instances will use the new one.

    Windows doesn’t do that. On Windows, the file path is the main identifier for the file. Files that are in use and executables that are running are locked and can’t be modified. It tells you to restart so that it can swap in the new files after closing everything. When updating a program, you just need to close it to be able to update, but OS files need reboots because they’re locked the whole time the OS is running.

    Note that some versions of Windows don’t require that any more. Some editions of Windows Server 2025 support hotpatching. This patches code (both OS code and program code) directly in memory, avoiding the need to restart to apply the update. On Linux, there’s a proprietary system called Kernelcare that does the same thing for kernel patches.