6

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.

2
  • 1
    Understanding why may teach us ideas we can apply in our programming.
    – Will
    Apr 29, 2011 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.)
    – Apache
    Apr 29, 2011 at 7:39

1 Answer 1

1
<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.

3
  • But why does this make it slow. May 30, 2011 at 3:48
  • 1
    because it waits for everything to stop
    – bubu
    May 30, 2011 at 7:01
  • 1
    @bubu but does ubuntu quit without notice ?
    – Timeless
    Jul 16, 2012 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .