Why does ‘turn it off and turn it on again’ work most of the time?

503 views

Why does ‘turn it off and turn it on again’ work most of the time?

In: Other

6 Answers

Anonymous 0 Comments

People talk about software only, and that part is not true anymore on computers with modern operating systems.

Modern systems basically provide software with resources that get extremely monitored. For example a program is going to ask some memory space, but if by mistake it tries to write outside of it, the operating system will terminate it without getting in trouble.

Someone gave the example of a pool, but this is not how it works anymore, and the “liquid” part is wrong too. So imagine a pool filled with a very easy to cut solid.

Programs are basically buckets that ask the operating system to fill them with various resources(ram, cpu, access to hardware) . The OS takes said resources from the pool and puts it in the bucket. It monitors everything. If the programs tries to access a resource it was not allocated, it will be stopped by the OS. The OS abstracts everything: a program may believe it is writing at a specific address, but it is not; the OS intercepts it, checks everything, then map it to the real address, which is different.

If the program does something forbidden, like writing outside its allocated ram or reading a register from a hardware that it is not supposed to have access to , the OS terminates it, empties the bucket outside, then puts back as much fresh solid in the pool as there was in the bucket, in the same shape it put in the bucket.

The next problem has become memory fragmentation, but this too has been a bit solved.

After some time, you have tons and tons of buckets of various sizes in use, and many programs have been terminated, either by the OS or they did their job and were stopped.

Since the OS returned resource in the shape it allocated them to buckets, you now have tons and tons of small bucket shaped stuff in your pool, and the OS cannot allocate multiple small buckets to fill a big bucket. So there still are resources available,but you cant use them. This is memory fragmentation.

So periodically, the OS will take small bucket shapes and fit them together again as one block it can cut from. On windows it started to work well with windows 7, and works very well with 10. So there really is not more need for a software reset, as long as this works… and as long as there are not gazillions of programs slowly reserving all the resources.

The problem switched from being caused by improper OS protection to improper usage from the user. Resetting the device at this point kills the prgrams, and the OS gets back all the resources.

But this is only a software reset case, not a turn it off and on again case.

Turn it off and on again means going hardware. Chips have bugs, just like software. They can start doing stupid stuff and need to be power cycled so capacitors get emptied, for example.

You are viewing 1 out of 6 answers, click here to view all answers.