To view parent comment, click here.
To read all comments associated with this story, please click here.
In that case Vista must decide to rewrite the entire hard disk just for good luck, with the amount of churning and how long it takes. I've seen Vista laptops take three to four whole minutes to shut down! That isn't dumping buffers, that's earnestly trying to hit the MTBF
Regarding the question
Why does it even touch the disk at all?
you gave a good explaination. I'd like to add the following:
Most users coming from a PC background do not see that UNIX is meant as a multi-user multi-process operating system. So it may be possible that many users are working on the same machine when it shuts down. The OS usually gives shutdown warnings, giving users the time to finish their work. Then, specifig signals are used to make the running applications do their own "shutdown stuff", e. g. saving unsaved files to disk so they don't get lost even if the user forgot to save them. After this, the applications are requested to terminate theirselves.
As you mentioned, data usually is written asynchronously. So the OS usually waits some time until all buffers are flushed at shutdown.
Understandable. :-)
As I see it, these people complaining of long startup/shutdown times have all the right in the world to be dissapointed with "modern" OSes in this respect - taking into account that (their) earlier very simple machines like the Amiga, C64 and the ZX Spectrum did this in one second or so, literally. Also lots of computer-like appliances such as mobiles, MP3 players, PDAs etc, do the same - this is true regardless of technical resons!
As a 42 year old man coming from a diverse electronics, PC, mathematics, compiler design, and datalogi ("computer science") background, I certainly see that "UNIX is meant as a multi-user multi-process operating system". In fact, I have tried to figure out - for the last quarter of a century or so - why an old time-sharing system like UNIX would be regarded a good basis for something resembling a personal computer.
UNIX was originally designed back when CPUs were almost 100 times as expensive as today and therefore had to be shared among many users. Computers were also at least 1000 times as slow and had perhaps 1/10000 the amount of memory, which originally restricted operations to primitive serial character processing very far from today's graphical interfaces. As most people here know, this has very strongly affected the basic architecture of UNIX, and this backround does not fit today's and tomorrow's demands very naturally (with many CPUs per user instead of the other way round).
UNIX/Linux should probably be redesigned almost from the ground up, or simply replaced, when in comes to use in personal computers (servers are another matter).
Moreover, today, the habit of not turning a PC off (or even "hibernate") in order to hide the ridiculously looong boot times is simply immoral, as power draw from computers has emerged as a major environmental problem - think about if we did the same with our TVs.
Edited 2008-05-18 13:43 UTC







Member since:
2007-05-20
Why does it even touch the disk at all?
An (oversimplified) explanation is this:
Most of the processes you mention maintain data files on the filesystem, constantly reading and writing to it. An obvious example is e.g. a database system. The OS itself does not immediately commit all writes to disk: it prefers to keep some of them in memory and flush them to disk at the best opportunity (i.e. when load is low etc). This is necessary, since disk writes are costly (hard disks may be very fast these days, but they are still a lot slower than main memory). Other things to consider are: Processes which are swapped out to disk, files that are cached and so on. At any point in time, the filesystem has open files, with data either waiting in memory to be written or being currently written. When an application knows it will access the file again soon, it will not close and reopen it (this is costly as well).
When you shutdown, every process must be stopped, and all the data has to be actually written on the disk platters. Only then is the filesystem consistent and ready to be unmounted. Depending on how many apps are running and the amount of writes still pending, this may take some time.
Having said that, I rarely turn off my Linux/BSD systems, so this does not affect me
Edited 2008-05-17 19:36 UTC