ELI5: Why does a computer need to restart to complete installing Windows updates?

r/

ELI5: Why does a computer need to restart to complete installing Windows updates?

Comments

  1. berael Avatar

    You can change the radio station in your car while driving, because the radio is not fundamental to the car’s operation. 

    But you cannot change the tires while driving, because the tires are fundamental. You need to stop driving and lift the car up instead to get a tire off. 

    You need to stop using Windows and restart it for the new tire to get installed before it starts back up. 

  2. fiskfisk Avatar

    Imagine you need to change a part in your car’s engine – it’s easier to replace the part when the engine isn’t running.

    That’s not say that it’s impossible if you design for it from the start, but it’s easier if you can just stop the car and do the replacement. 

  3. Thesorus Avatar

    Some files/programs in the operating system (OS) are always in use by the OS and cannot be overwritten “live” without crashing the system.

    The computer needs to reboot in a semi workable state to be able to replace those files safely.

  4. boring_pants Avatar

    It doesn’t need to, but it is the simplest way to ensure that the updates have taken effect.

    Windows prevents files from being updated while they’re in use, which means that not everything can be updated while the system is running. Instead, it records a set of instructions for later, like “once everything shuts down, swap out these old files with these new ones”

    There are other ways in which this problem could be solved: Linux for example does allow files to be replaced while they’re in use. It just means the program using them continues to see the old version while everyone else sees the new version. That makes it easier to install updates without rebooting, but the downside is that now some of the programs you have running might still be using the old un-updated files, so even then, rebooting is a nice, clean way to ensure that everything is updated.

  5. freakytapir Avatar

    Imagine trying to do maintenance on a shop/factory floor while the shop is running. People moving about, stuff happening, people getting in your way … You can do it, but you still need the shop empty to do certain bits. So you send everyone but maintenance tech home for the day and get to work.

  6. Gnonthgol Avatar

    The way we implement functions and logic flow in programs is by return pointers. When you want to run a function, for example printing some text, you tell the processor to start executing code at this new location for the print function and then make sure the print function knows what text to print and also where to return after it is done. When the print function have done its thing it will then tell the processor to continue executing code at the address specified in the return pointer.

    When you change code all these pointers changes. You might have a function take up 100 bytes, and right after it there would be a new function. But then you find a bug in your function and by fixing the bug the function now need 110 bytes. That would push the next function and all the other functions back so all the addresses would change. This is a problem if there are a bunch of return addresses all over the place. So you need to make sure all the functions are done running and all return addresses have been used up before you can replace the code with the upgraded code.

    The same is also true for data structures. You may have a data structure in memory with four variables and a lot of code which expect there to be four variables. But to fix a bug you might have to add one variable to the data structure which brakes all the code.

    This is why you need to restart an application after an upgrade. And for important system libraries that are used by a lot of applications you would have to restart all those applications. A lot of services on a computer is hard or impossible to restart on its own. For example there is an application responsible for all the graphics on the desktop so you would have to restart all applications using the display in order to upgrade this. And then there is the kernel which runs everything on your computer. So restarting the kernel is basically restarting the computer.

    Windows is a bit aggressive about needing restarts. A lot of the bugs can be fixed just by restarting the applications which are affected. A lot of bugs are not even worse then having to restart the application anyway when the bug happens. Most other operating systems do allow you to reboot at your own time or even not tell you to update if it is just a minor update. There are even systems that are able to fix the return pointers and data structures so you do not need to restart to get the latest update although these systems are mostly used for enterprise servers as they are expensive to maintain.

  7. dswpro Avatar

    Some parts of windows only get loaded upon startup and cannot be replaced or modified while operating and other apps are using them. Windows schedules tasks and manages all the shared resources on your computer. It cannot retain “state” while fundamental sections of code are being updated.

  8. enjoyoutdoors Avatar

    Thick of the work environment you have in your computer as a brick that is placed on a pile of other bricks.

    You only care about the brick on the top, but it’s supported by 50 bricks underneath it that you can’t tug out from under you without your own brick at the top falling over in the process.

    Every time the computer starts, it starts piling up the bricks that you will place your working environment on.

    If you want to replace brick 13 and 24 (as an example) in a system update, you need to figure out a reliable way to tug out brick 13 without having brick 14-50 fall over in a rubble at your feet. And then you need to do the same thing with brick 24, without seeing brick 25-50 fall over. Right after you piled them up for the sake of replacing brick 13.

    That does sound unnecessarily complex, doesn’t it? Especially since restarting the operating system means that you get immediate access to the function that restacks the entire pile?

    This is the “the simplest solution is often the easiest solution”-philosophy of software updates.

  9. Wendals87 Avatar

    Basically it updates files that in use by the system at the time

    To replace the files and update it needs to restart so it can replace them when they aren’t in use

    That being said, there are upcoming changes to windows updates to make most of them no longer require a reboot (for Windows 11 enterprise currently but hopefully to pro or home at some stage)

  10. duhvorced Avatar

    Software works in layers. When you turn a computer on and open up an app (like a browser), the computer loads up its memory in much the same way you might pack a moving van. Big stuff at the bottom, smaller, more delicate stuff at the top, with each piece fitting into whatever nooks and crannies there are below it.

    In a computer, each layer of code has specific nooks and crannies (functions, state, APIs, etc…) that the layer above connects to. You can’t just yank something at the bottom out and replace it without risk of breaking everything above it.

    And that’s what operating system updates are doing. They’re updating low-level stuff that everything else depends on. Doing that without restarting (unpacking the van and starting over) is all but guaranteed to cause problems.

    Hence, power off.

    …then power on.