Why is ubuntu shutdown so fast compared to Windows 7

6

1

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.

9ikhan

Posted 2011-04-29T05:39:14.273

Reputation: 161

1Understanding why may teach us ideas we can apply in our programming. – Will – 2011-04-29T05:42:34.947

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 – 2011-04-29T07:39:42.193

Answers

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.

bubu

Posted 2011-04-29T05:39:14.273

Reputation: 9 283

But why does this make it slow. – deceleratedcaviar – 2011-05-30T03:48:52.143

1because it waits for everything to stop – bubu – 2011-05-30T07:01:31.153

1@bubu but does ubuntu quit without notice ? – Timeless – 2012-07-16T16:34:09.827