Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed Windows 7 64 bit and Ubuntu 10.10 32 bit on my machine. The partition sizes are 400 GB and 100 GB receptively. I've always wondered how Ubuntu shuts down so fast? It takes only 5 seconds or less whereas Windows 7 takes a lot longer.

Although, I have more programs installed on Windows 7, but still its shut down time was much more than that of Ubuntu during first month of install. It was 10-15 sec approx. I'm not counting the time used for installing updates sometimes, when shutdown is clicked in Windows 7.

What makes Ubuntu shutdown and boot(faster than Windows 7 but not by wide margin) so fast. Is it the file system? will it be other way around if I had swapped partitions spaces(Can't try this now)? Sorry I don't have Computer Science background, so don't know detailed structure and architecture of OS. Any pointers to this will help me cure my curiosity.

share|improve this question

migrated from stackoverflow.com Apr 29 '11 at 5:47

This question came from our site for professional and enthusiast programmers.

1  
Understanding why may teach us ideas we can apply in our programming. –  Will Apr 29 '11 at 5:42
    
If you apply the "Win reg hacks" to make Windows force everything down like Ubuntu does, it'll shutdown in a few sec. Win shutdown things gracefully, real soft. Ubuntu just force shutdowns things most of the times. (And there is a HUGE diff between the services too.) –  Shiki Apr 29 '11 at 7:39
add comment

1 Answer

<p rant="on"> Well, to be honest, I don't think understand why will do programming any good. In addition, I don't honestly understand why this is migrated to SU in the first place (Other than SU being a rubbish bin for all irrelevant questions for many stackoverflow users</p>

The windows shutdown process can be seen as a two step process:

  • from "Logged on" to "No one logged in" (Hereinafter "Part 1")
  • from "No one logged in" to "Shutdown" (Hereinafter "Part 2")

In part 1:

ExitWindowsEx(uFlags,dwReason) is called - this is actually handled by winlogon. It sends WM_QUERYENDSESSION to all applications - and each of the application shall perform necessary procedures before shutdown and return true. It then receives WM_ENDSESSION and is terminated. This relates to all process in session 1 (The so-called "interactive session")

Then:

  • user profile is updated and unloaded
  • network connection (including VPN connections, if any) is terminated
  • COM processes are terminated

In part 2:

The non-interactive session (session 0) would also have all its application terminated in similar manner (Impersonating Local System user account), and services would be shut down.

After all these, the system would be shutdown.

share|improve this answer
    
But why does this make it slow. –  RommelVR May 30 '11 at 3:48
    
because it waits for everything to stop –  bubu May 30 '11 at 7:01
    
@bubu but does ubuntu quit without notice ? –  Timeless Jul 16 '12 at 16:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.