Changes to power management in Windows Vista


As I noted some time ago, it's hard to get programmers excited about power management. What's worse, programs that do take the effort to care about power management often do it rudely, hijacking your computer and preventing you from going into standby or hibernation, instead preferring to drain your battery until the computer just dies from lack of power.

The Power Management folks decided that they've had enough with these selfish programs and redesigned the way power management works. In addition to exposing finer control over various aspects of power management to the user, they also decided to "take the ball and go home" when it comes to programs rejecting suspend or hibernation requests. When the user asks for the computer to go into a low power state, programs will get notified of the state change but are not allowed to veto it. Programs get two seconds to clean up, and then that's it. The laptop is going into standby, ready or not.

If you ordered a copy of the PDC DVDs, you can go back and watch session FUN319 to learn more. (Here are some follow-up remarks to that session.) I'm not the expert in this area; I'm just repeating what I've heard. If you have questions about the future of power management, you probably should ask the power management folks over on the Windows Mobile PC Team Blog.

Comments (70)
  1. Anonymous says:

    Somehow, I have a feeling that programs will find a way around it anyway. Probably involving hacking the registry to turn off power management or something.

  2. Anonymous says:

    Essentially, is this process time or real time?  Two seconds of real time does seem increadibly short.

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]
  3. Anonymous says:

    Question… What about apps (such as media players, games with long
    cenematic sequences, etc…) that prevent the screensaver from
    appearing? has that changed, or is it just the user-initiated suspend
    thats changed?

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]
  4. Anonymous says:

    Doh!

    s/This program probably/This code probably/

  5. Anonymous says:

    The entire OS should be designed around distrusting application-level programs, because they’ve proven themselves to be as selfish as they can possibly be.

  6. Anonymous says:

    I am surprised! My Vista PC has stopped doing any power management
    at all! It does not show the screen saver, it does not go into standby
    etc. The only thing it does is go into sleep mode when I push the
    button. So, that is what I do; nothing automatic here. What can be the
    problem? It did work before; until now I had the belief that one of the
    updates killed power management.

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]
  7. Anonymous says:

    I like how after Raymond says he’s no expert and he doesn’t have the answer, AND points people at the right people to ask questions… people still post questions here.

    Anyway, the answer is, "well, the program’s just going to have to cope with whatever Windows does, won’t it?" If software developers haven’t abused the OS’s good faith in the past, it wouldn’t have to set deadlines like this.

  8. Anonymous says:

    I second Adam’s comments.  Not just for
    hibernation/standby/sleep requests, but for shutdown, too.  At
    shutdown you get 5 seconds, which can be a lifetime on a machine with a
    fast disk and plenty of memory.  But heaven help you if you only
    have a megabyte of RAM or if you have other apps contending for the
    same resources.

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]

    I would have prefered a scheme that scales to the power of the
    machine and/or the number of processes running.  For example, send
    each process the signal sequentially, momentarily boost their priority,
    and given them 150-200 ms.  By serializing, you eliminate most of
    the contention for I/O, so you might be able to hibernate/shutdown even
    faster.

    BTW, does anyone have a mnemonic for remembering the differences
    between standby, hibernate, and sleep?  I can never remember which
    mode is which.

  9. Anonymous says:

    This is really good. Really good.  I have a (uh oh) system tray applet I wrote myself to do exactly this, because I got fed up with taking the laptop out of the bike and discovering I’d been cycling home with a spun up hard disk and now had a flat battery with some risk of HDD damage.

    I think too many developers thought that if they stopped you suspending, they’d stop you disconnecting from the network, which was usually their real goal. But the reality is people are going to pick up their laptop and go wherever they go, and apps have to get over that.

    What will be interesting is whether forcing apps to deal with this problem will result in apps that adapt better to changes in network state. Now that they can’t stop you roaming with their laptop, they had better learn to work well in this condition. Except java apps of course, for there is no power management or network state API in Java SE. But that’s Sun’s fault, and probably stems from them not having any laptops of their own.

    -steve

  10. Anonymous says:

    So let’s hope you don’t accidentally hit suspend when you’re burning a CD, or recording a television show, etc.

  11. Anonymous says:

    Lord knows I have tried to use sleep/hib on Vista but I keep running into trouble. If I’ve had the notebook off for more than about a day, several services fail on resume because they all rush for the network and it’s not ready yet. There is no knob I can find to tell them to back off. The good news is that Vista does a much more thorough job of logging these problems. Maybe that will lead to action to fix them.

  12. Anonymous says:

    So I was responsible for the code which does cancels shutdown/hibernate in a major media type app (read ITunes like) while cd burning / ripping / device transfer is in session.  What do you do if your app is burning a CD or worse transferring to a device and the conputer wants to shutdown?  You could end up destroying al the meta data on an ipod type device.

    Have these problems been considered?

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]
  13. Anonymous says:

    I’m very happy to hear about this change. Closing the lid of my laptop isn’t a request, it’s a demand. Unless I’m running air traffic control software, there’s nothing more important my computer can do than shut down and not overheat, and I’d like to think I have more sense than to run air traffic control software on my laptop.

    Rob Rightmeyer: If my app is burning a CD, I’ll accept a coaster. I didn’t hit Suspend and confirm the action by accident, nor did I close my laptop by accident, and I can hear the CD drive working. If it’s ripping a CD, I’d like it to start at the same track next time, but this is such an exceptional case that I’d be OK if it just started the CD from scratch.

    If you’re transferring data to a device… well, connections fail anyway. Users yank cords out, power fails, OSes crash. Hopefully the device’s software is robust enough to deal with these situations without any gereivious damage. And just to soften the blow even more, you probably get several dozen milliseconds to set things right.

  14. Anonymous says:

    Why do I have a sneaking suspicion that in the end this behavior will be retained for the sake of backward compatibility?  Not to mention the legitimate reasons for retaining this behavior stated above.  I guess you’re damned if you do, damned if you don’t.

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]
  15. Anonymous says:

    "Two seconds of real time does seem increadibly short."

    When I close the lid of my laptop, I intend to move it after a few seconds. The laptop had better be in standby or there is a risk to damaging the hard disk. What part of "standby NOW" do the programmers not understand?

    The reality is today’s computing environment is more empherical than ever. PnP means devices can come and go – including that disk with an open file on it. WiFi means network connectivity can be lost any time. Batteries can die at any time. Fast User Switching means the "current user" can change at any time.

    This stuff isn’t new, folks – deal with it, gracefully, if you please.

  16. Anonymous says:

    People… Maybe it’s just time to pay attention how it’s being done on the rest of the OS?

    Example: Linux just saves and then restores the whole memory (including caches) when going into hybernate mode. This means up to several mins before going down (around 1min per each GB of RAM I think), but it also offers same state at the wakeup, not just the windows core programs.

    Say if you were working in Blender with a complicated scene you’ll get everything restored. Even the mp3 song playing in the background. (in again less than a minute for a PC’s with up to 1GB RAM)

  17. Anonymous says:

    Well I guess when the user puts the system to sleep/standby/suspend/hibernate/…, I won’t have to do anything at all. When the system resumes, everything is still there. If there’s I/O going on, 2 seconds should be just enough to abort it. Besides, if the user is copying or downloading things, chances are (s)he knows about it, and expects it to fail after resume. A program can ask whether to try again, or just go ahead and try again automatically.

    Gee, is it me or is this whole "OMG 2 SECS?!" thing mostly moot? Or is it like, you write an essay in notepad, forget to save (/can/ happen), turn off the computer and have 2 seconds to read and response to, like "hey, do you want to save this? yes? what file name?"

  18. Anonymous says:

    So, my understanding is that you’re the expert in this area. Is that correct?

  19. Anonymous says:

    Somehow, I suspect Windows Update, Windows Installer, and Vista SP1 will still be able to cancel a suspend.  And probably Office 2009 as well.

  20. Anonymous says:

    @Sergey: As far as I know Windows does this as well with hibernate, granted the mp3 may stop but I have had it work on resume. I guess I don’t see what you’re getting at.

  21. Anonymous says:

    Ok, I understand all of the you should, the appliance should be able to, but MS shipped an OS with this api support and documented it, app developers took advantage of it, now the functionality is taken away.

    You have left a number of apps looking bad on Vista by doing so.  A users does not say, its the apps fault (and is it because they didn’t think what happens if my api is removed in the next service pack), they say this new OS is bad.

    BTW – sure if a BSOD occurs a user knows something bad happened, but if he was synching 10k tracks and walked away expecting his computer to stay running until it was done, should he need to go and reset the sleep settings prior to doing so.  What will Zune do?

    Larry’s idea of a software contract I believe comes int oplay here.  Vista violated it here.

  22. Anonymous says:

    Its really interesting to see people pushing back against this…usually developer’s who are doing use-once operations (like burning a DVD).

    Here’s a problem. The future of the desktop is the laptop. These changes to Vista are an acknowlegement of this.

    And when you undock a laptop, the system state changes. the external DVD burner? gone. the ethernet network? gone. This is going to happen to apps regardless of whether they get 2s, 5s or 0s warning. The fact you get 2s warning gives you enough chance to do some emergency actions -there’s nothing you can do to stop the laptop moving. Accept it.

    -You can always notify users on wakeup that they shut down and their DVD is a coaster. This code is useful to have anyway, because laptop critical power suspends never came with any warning.

    -there is that API call to tell the OS that a thread is busy. If you call it (and remember to keep calling it), the OS wont suspend due to perceived idleness

  23. Anonymous says:

    Why didn’t the Windows team provide a user interface that automatically displayed to the user which application(s) were refusing to shut down and then allowed the user to decide when to kill them?

    Good software is like a good employee. It puts the needs of the person it serves front and center. Arbitrarily killing a process after 2 seconds is a very lame solution. As a user, I don’t feel that this is really any better than the status quo.

    I am really disappointed at the lack of imagination displayed here. Stop thinking like attorneys and politicians and start thinking like engineers again.

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]
  24. Anonymous says:

    I don’t get it…. The USER (you know, the one calling the shots, the one that owns the device, the one running the software) tells Vista to go to sleep. And some of you are complaining that Vista actually goes to sleep? That it does what the user wants, and not what some random program manager wanted?

    I don’t think anyone is going to say Vista is a bad OS because it went to sleep when the user told it to go to sleep.

  25. Anonymous says:

    Thanks for the note.  Since a lot of developers read your blog, they know about something they may not have happened upon and know where to go for more information.

    I’m sure you don’t like the idea of being an information hub, but sometimes on this noisy network we call the Internet… well you know…

  26. Anonymous says:

    At the risk of admonishing the same way Raymond once admonished me:

    "Why didn’t the Windows team provide a user interface that automatically displayed to the user which application(s) were refusing to shut down and then allowed the user to decide when to kill them?"

    But I don’t want to see an interface.  I want the computer to go to sleep.

    Better yet, I want to close the laptop and it just goes to sleep automatically.  And I don’t care if the term is sleep or hibernate or innoculate or gyrate.  I just want to open the laptop later and go back to work.

    Being a new owner of a laptop with Vista, I can appreciate something like this.  I have done it several times already.

  27. dhiren says:

    "Why didn’t the Windows team provide a user interface that automatically displayed to the user which application(s) were refusing to shut down and then allowed the user to decide when to kill them?"

    Because in the power settings, when windows asks ‘what would you like the computer to do when you close the lid’ I’ve set my notebook to ‘hibernate’.

    Now, if I’ve closed the lid of my notebook, of what use is a confirmation user interface that allows me to decide when to kill apps that dont want to hibernate?  The lid is already closed. Closing the lid prompted the hibernation/sleep/shutdown even in the first place.  User confirmation is completely pointless.  

    Obligatory car analogy: if your car refused to switch off after you turned the key to the ‘off’ position just because the radio was still playing, you wouldn’t be impressed at all.

  28. Anonymous says:

    For the people who are saying "How could Visa do this to us!", I say "How could you do that to the user".

    It’s their machine, not yours. Sure, if it goes into sleep it might turn the DVD they are burning into a coaster – but that’s their choice. They shouldn’t have to justify their actions. Maybe some DVDs get toasted, and maybe the user will learn to better plan when they hibernate.

    Now if only they could translate this concept over to shutdown – though you’d probably want to introduce some standard behaviour for saving drafts etc (for unsaved documents).

  29. Anonymous says:

    "Stop thinking like attorneys and politicians and start thinking like engineers again."

    Could you elaborate on how ignoring veto requests is a solution that an attorney or politician would come up with, but not an engineer?

  30. Anonymous says:

    Two seconds? Do you happen to know if that’s per-process, or for the whole system?

    Say you’ve got a system with a lot of programs on it, some of which have been idle for a while. Then the user hits “standby”.

    Now, all these programs wake up *at the same time* and run their
    “computer is going into standby” code. This program probably hasn’t
    been run before since the program was started, so it has to be paged in
    from the exe on disk for each program. Lots of reads going on.

    Meanwhile, each program, as it gets to run its “going to standby”
    code starts accessing its state, which needs to get swapped in from the
    pagefile, and writing it out to disk, causing cueing a bunch of writes.
    As the computer’s going into standby, you probably want to make sure
    the state’s written, so throw in a couple of sync()s as well.

    Multiply this by 20-odd processes (conservative guess?) and your
    disk starts thrashing wildly as all these processes tries to get even a
    small amount done in the *same* 2-second window.

    2 seconds just doesn’t sound like a lot to me, given how long it can
    take windows to redraw the screen sometimes when you unlock it having
    been away for a while. I sometimes get a 2-3 second pause before
    everything’s up again in that sort of situation, and it’s “only” going
    to be issuing reads then, not writes.

    [“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]
  31. Anonymous says:

    —-"I don’t think anyone is going to say Vista is a bad OS because it went to sleep when the user told it to go to sleep."—–

    But they want it to go to sleep without trashing their data and their hardware. Two seconds just seems too short a time. Even when nothing is stopping standby it still takes my computer around ten seconds to standby.

  32. Anonymous says:

    James > Well, I would ask the members of the mobile blog as Raymond suggests, but there’s no “contact us”/”suggestion box” for the blog, the “winmobl” user that posts to the blog has no other contact details (e.g. email), the blog’s not been posted to in about a year and a half leaving me to wonder if there’s anyone still there anyway, and for the posts that *do* exist, anonymous comments have been disabled, so I can’t ask a question if I want to! (And if I did register, I wouldn’t be surprised if comments were disabled on 18-month old posts – they’re disabled after what, 2 weeks(?) on Raymond’s blog.)

    On top of that, the “wvdroadmap” article that Raymond links to has no information on the 2-second rule, and the “help file” that the page says it is a summary of is an executable that probably won’t run very well on my Linux/PPC system.

    So, I though I’d ask if he “happened to know” a bit more on that particular policy. I didn’t ask him to go and find out (or write a white paper :), just if he happened to know a bit more about something he’d already looked into enough to at least post about.

    *shrug*

    [I don’t happen to “know” anything. As I already noted, “I’m not the expert in this area; I’m just repeating what I’ve heard.” I have heard stuff, I have ideas, but I dare not express them because people will turn my guesses into fact. -Raymond]
  33. Anonymous says:

    The problem is… sometimes I didn’t ask it to sleep/hibernate (or even shutdown)… I mistakenly hit those new effing keys they put on new keyboards!

    And if you are a keyboard designer, where do you put new keys? If you answered "In a free zone", you are fired! You of course put them where used keys (like print screen or better, insert, delete etc.) were. You can even use the new keys as excuses to reorganize the whole right part of the keyboard.

    The good news is that my 5 euros keyboard is almost correct, the insert-delete-home-end-etc block didn’t change shape, it just shifted 1-row below to accomodate for print-screen, scroll-lock & co that were displaced by sleep, shutdown & hibernate.

    Other more expensive keyboards (even those 150 euros keyboards from MS) all do worse things like shrinking the "0" key on the keypad to accomodate the right arrow, having a shutdown key in place of the escape key, having a right shift and/or return key of funny size, or a  half-width backspace to make you type a letter instead of erasing one (good trick since you are already annoyed by the mistake you are trying to remove)

    This new keyboards are almost as annoying as the terminal settings in unix/linux.

    Sorry Raymond, I needed to vent a little bit…

    To be a little on topic, my hope is that somewhere in the future I will be able to choose when to do a forced sleep (like when I close a laptop lid or hit the power button on the case) and a more mistake-friendly sleep request that i can cancel (when I hit those too powerful new keys)

    Or maybe just disable those keys.. THAT would be good.

  34. Anonymous says:

    Next step: When the user says "safely remove hardware", you unmount it without complain. Windows doesn’t block CD/DVD drives from ejection, why should it block removable drives? Besides the user is going to unplug it anyway.

  35. Anonymous says:

    I can’t help wondering that if an app has been swapped out due to being idle, what exactly is it that it *must* do when a standby event occurs?  (Bearing in mind the battery could die at any point anyway, of course.)

    2 seconds seems reasonable to me.  My experience of standby etc on laptops has so far largely been a case of "Would you just shut the hell down already?"

    I remember watching the C9 video about this topic when one of the Vista devs said that when a program says it wants to veto the standby, then Vista just says "Hmm. Interesting.  Not gonna happen."  

    I think I may have punched the air at the time :-)

  36. Anonymous says:

    Next step: When the user says "safely remove hardware", you unmount it without complain. Windows doesn’t block CD/DVD drives from ejection, why should it block removable drives? Besides the user is going to unplug it anyway.

    Because the filesystem doesn’t always have the HD in a perfectly synchronized state. What I’d prefer is a way to signal that I want to unmount a HD as part of the hardware – turn a knob, watch the light go from red to green, and pull the HD out.

  37. Anonymous says:

    Rob, I agree published API should not break. But that is the price of vendors taking too many liberties and not playing "nice."

    IMO, it is also the price of not knowing who’s at fault, or at least who contributed to the problem. And as Raymond has pointed out, Vista is helping by logging far more info about PnP, pwr management, etc.

    Just yesterday I tried to Remove a USB disk. Vista gave me the usual line that it couldn’t. (I tried many times) The Event Log says "process ID 4 (System)" prevented the removal. It also told me some other things too, which I took care of.

    I’m glad Vista is giving that info now. Still not happy that System sometimes won’t let go of idle disks, but that’s another problem.

    Somebody should write a Sidebar gadget to show those event log msgs when pwr mgt or HW removal is denied. :=)

  38. Dean Harding says:

    My guess is that 2 seconds is wall time, and while it may be per-process, every process is sent the notification at the same time.

    To me, that sounds perfectly reasonable. Simply because 99% of apps would IGNORE THE NOTIFICATION. That is, 99% of apps don’t need to know when you’re going into standby or hibernate. The only apps that I can think of that would need to know are the ones people are complaining about here: cd-burning, ipod-transferring, etc. Basically anything that interacts directly with external devices.

    But how many instances of iTunes do you run at the same time?

    The fact is, for 99% of applications, they won’t even NOTICE that you just went into/came out of standby.

    I do agree with "A" as well. The next logical step is to make "safely remove hardware" work all the time, even if someone has a handle to a file on the device open. Basically, Windows just has to flush its own buffers, and thats it. Give the app 2 seconds (like standby) to finish up with the handle, and let me take the device out. Otherwise, I’m just going to yank the device out anyway.

  39. Anonymous says:

    "What do you do if your app is burning a CD or worse transferring to a device and the conputer wants to shutdown?  You could end up destroying al the meta data on an ipod type device. Have these problems been considered?"

    Rob, have you considered what would happen if the computer BSOD? Or the absent-minded user unplugs their ipod because they *think* the transfer is done.

    At least with normal power mgt, you get a notification and a chance to "cleanup." No such luck with those other unexpected scenarios.

    A properly designed app could withstand the unexpected. For example, with metadata journaling, the app won’t "end up destroying al the meta data"  You might lose the song that was being transfered but it should never trash the entire device.

    (I know there’s no such option with CD burning. Those are the breaks, oh well.)

    A blanket "veto suspend" seems like a big kludge to compensate for fragile designs. It’s a kludge at the expense of a good user experience and of other apps – remember, *your* app isn’t the only thing a real user does.

  40. Anonymous says:

    > programs that do take the effort to care

    > about power management often do it rudely,

    > hijacking your computer and preventing you

    > from going into standby or hibernation

    Even though it has become obvious to long-term readers that you know how many bonuses your colleagues got for rude misfeatures like this, it still would help if you add something like “Yes my employer is included”.  When you don’t say that, your complaints still look hypocritical.  This is from the viewpoint of someone who waited for Windows Update to download around 60 critical updates, who then stupidly wanted to hibernate the machine and take it away and let the updates install later.  Silly me.  It would have been better to leave it without the critical updates, eh?

    By the way, does anyone know why the redesigned power management documentation is country-specific?  (And by the way there are some engineers even in Indonesia who are better at engineering than at English.)

    [I already said it. And you’re breaking the ground rule on not identifying programs by name. -Raymond]
  41. Dean Harding says:

    Even though it has become obvious to long-term readers that you know

    how many bonuses your colleagues got for rude misfeatures like this,

    it still would help if you add something like "Yes my employer is included"

    But you seem to be asking for the exact functionality that was disabled in Vista — that Windows Update to have been able to abort the hibernate until it finished. Better that the updates failed to install that the hibernate was cancelled (well, even better would have been that they were paused and you could resume where you left off…)

    Is Windows Update able to handle yanking the network cable out gracefully? Apparently not if it can’t handle going to into hibernate…

  42. Anonymous says:

    @Brent Royal-Gordon

    "Somehow, I suspect Windows Update, Windows Installer, and Vista SP1 will still be able to cancel a suspend.  And probably Office 2009 as well."

    This is one of those cases where you should really try this out before typing.  I just started an update I wouldn’t mind getting hosed (Korean language pack, I think) in case it didn’t work on Vista and triggered a suspend. Then for good measure I flipped the switch on the PSU.  When I turned it back on, guess what?  The update was still going where I left it.  And WU didn’t block the suspend.

  43. Anonymous says:

    Forced poweroff sounds reasonable for me. Afterall, if the battery runs out, you get hard power down.

    If you don’t want the accidentally stop in midway (like burning a disk), I guess you should always perform those task with your laptop power cord plugged.

  44. Anonymous says:

    Monday, April 16, 2007 9:58 PM by Dean Harding

    ? But you seem to be asking for the exact

    ? functionality that was disabled in Vista

    Huh?  I said I wanted to hibernate the computer and take it away, but the unnameable update program prevented going into hibernation.

    ? Is Windows Update able to handle yanking the

    ? network cable out gracefully?

    Oddly enough, for about 98% of updates it does figure out not to repeat the download.  But that was a non-issue in this case, because as stated, I had waited for the downloads to complete.

  45. Dean Harding says:

    Huh?  I said I wanted to hibernate the computer and take it away,

    but the unnameable update program prevented going into hibernation.

    Oh sorry, I thought you meant that Windows Update didn’t handle the hibernate properly; not that it had simply prevented it. Fair enough then.

  46. Anonymous says:

    This is good for everyone in the long run. I have my UPS drained countless times because one rude game or many rude programs refused to let computer go to sleep in case of power failure, if I was away only for a couple of minutes.

    Please stop chanting "["I’m not the expert in this area; I’m just repeating what I’ve heard." -Raymond]" Raymond.

  47. Anonymous says:

    Stephen: "But they want it to go to sleep without trashing their data and their hardware. Two seconds just seems too short a time. Even when nothing is stopping standby it still takes my computer around ten seconds to standby."

    I don’t have a copy of Windows (Vista or otherwise) on my laptop (a Dell, for reference) at the moment, so it’s a bit hard to compare exactly. But when I close the lid currently, it takes approximately two seconds to go to stand by. There’s a brief flash of disk activity (mostly doing a sync), then *bam*, it’s done. 10 seconds sounds more like a hibernate kind of timeline to me.

    I’m sure lots of apps would like to do clever things when it suspends, but how many of them actually *need* to? I always saw the whole point of standby being that the machine goes to sleep, and at some later point wakes up with everything in exactly the same state it was before. Yeah, there are a few cases where programs might need to do something clever, but frankly it’s probably pretty rare compared to all the malfunctioning bits of crapware that just don’t respond to the message and cancel shutdown regardless.

    And yeah, there will be things (like CD burning) where this could cause trouble, but any user who suspends halfway through burning a disc deserves to get a 50c coaster.

    I think the Vista engineers have made a great choice here. A few weeks ago my XP box at work went through a phase where it childishly refused to shut down; no doubt one of these not-responding-to-message situations was occurring. Nice to think the newer version would have handled it better.

  48. Anonymous says:

    [quote user=”Tanveer Badar”]

    Please stop chanting “[“I’m not the expert in this area; I’m just repeating what I’ve heard.” -Raymond]” Raymond.

    [/quote]

    Yup. It’d be better to just put the disclaimer at the article itself, as many people write comment without fully read others comment first. Raymond would in the end repeat many more times than necessary.

    [The disclaimer is in the article itself. That’s why I put it in quotation marks. This just proves that nobody reads the article or the comments. -Raymond]
  49. Anonymous says:

    Interresting article Raymond.

    Having the chance to chat to an power management expert, could you tell me if there are any changes in Windows Vista and power management?

    (Hope you get the insinuation)

  50. Anonymous says:

    All of this sounds pretty reasonable, but still doesn’t fix the most annoying problem with windows’ power management; the lack of any confirmation when the sleep or on/off buttons are pressed.

    It seems that nobody at Microsoft has ever left their laptop on a chair and had a small child come up and press the big shiny button. Or accidentally pressed it themselves (it can be annoyingly close to other keys).

    It’s even worse in no-veto Vista, where unless the app you are working with has an autorestore-type abilily, you *will* lose work.

    Add to this that my laptop doesn’t wake up from sleep anymore in Vista (probably not MS’s fault, not blaming you) and things can get very annoying.

  51. Dean Harding says:

    > It’s even worse in no-veto Vista, where unless the app you

    > are working with has an autorestore-type abilily, you *will* lose work.

    That would only be the case if, when thebutton is pressed, the computer SHUTS DOWN. If it just goes into hibernate or sleep, then the application won’t even realise it just suspended/resumed.

  52. Anonymous says:

    One other power management annoyance (in Windows XP) is that if a hard drive is shut down because you set a drive shutdown timeout, then when you shut down the computer that drive is woken up just to immediately be shut down again a few seconds later.

    This is probably not Windows XP’s fault, and I have no idea what it’s like on Windows Vista, but I still wonder if it’s possible not to wake up the drive during computer shutdown.

  53. Anonymous says:

    [The disclaimer is in the article itself. That’s why I put it in quotation marks. This just proves that nobody reads the article or the comments. -Raymond]

    Oh, actually I mean have a seperate paragraph beginning with “Disclaimer:…”, just like what you done with “Nitpicker’s corner”.

    Separate paragraph with heading makes it more “detectable”.

    [Remember when blogs didn’t have to have “Nitpicker’s corner” and “Disclaimers”? I miss those days. -Raymond]
  54. Anonymous says:

    We already have a user interface for when a program doesn’t want the computer to be shut down. And it typically obscures the dialog that the program has displayed to explain why. So much for a user interface for the sleep key.

    I don’t actually suspend/sleep on lid close, because what I want to do is to carry the laptop from one room to another without losing my TCP connections (wireless LAN), and carrying the laptop with the lid open is too unwieldy.

    In fact, several times I’ve opened someone’s laptop only to see it resume shutting down…

  55. Anonymous says:

    This just proves that nobody reads the

    article or the comments.

    Finally!  It’s about time I got some respect.

  56. Anonymous says:

    Once I was burning a music CD on my laptop, and accidentally hit the lip with my elbow and triggered standby. When I resumed, the CD continued burning, and came out fine (with a few skips though). This was XP and Nero 7.

    Also, my wife regularly watches movies and streaming video on the laptop until it drains the battery. When I turn it back on, the show continues to run (until the buffer runs out, at least).

    And I agree, when the lid is closed, I’m not going to look at some UI. I’m going to pull out whicever cords are connected (dock / power / network), and put the computer in my backpack. The worst effect a program can have is make the computer still run inside the backpack (happened once alreaday).

  57. Anonymous says:

    All these comments from people pooping themselves that their app will be forced to shutdown when the user tells it to. lol.

    If they’d read the linked blog to the expert, they’d have read this:

    "That said, we also want to give customers a fallback for critical pre-Windows Vista applications that break under the new model. They will be able to set a power option that restores the veto capability"

    I guess that it will be disabled by default, and the user will have to set it, but I have no doubt a poor app will set this tweak in the registry when installed. Life is not any better than before :(

  58. Anonymous says:

    "Could you elaborate on how ignoring veto requests is a solution that an attorney or politician would come up with, but not an engineer?"

    Imagine that there had been no science and engineering during the past 100 years. The Wright brothers first flew in 1903. Without engineers, there would be no air transportation. Penicillion was discovered in the 1940’s. Without scientists, we would have no antibiotics.

    Attorneys and politicians would have spent the past 100 years looking for ways to restribute wealth. But the quality of life would not have improved much. Improving life for others takes imagination. This power management thing smells like a legalistic solution because nothing new has been imagined. They simply changed who gets the final say.

    Others had given circumstances in which a user might trigger a hibernation unintentionally or without fully realizing the consequences. Smart people who are busy sometimes make mistakes.

    How about giving an audible alert if the laptop is closed and something doesn’t want to shut down?

    The "selfish programs" comment by Raymond really irked me. What if your software makes Automation requests of Office or other programs? Do all Microsoft products that provide Automation interfaces honor hibernation requests while servicing an Automation request? How fast do they respond? How can anybody predict what will happen if their single-threaded app is waiting on an Automation server to complete a request? Does every such application now need to be multithreaded?

    Being "not selfish" is not as easy as it might seem. The devil is in the details. Raymond shouldn’t assume that people are "selfish" just because they don’t meet this particular requirement. Providing excellent software for customers requires balancing thousands of issues.

    Case in point: Install Word 2003 and Word 2007 on teh same syatem. Open a document in Word 2007. Then open a document in Word 2003. Now reopen the first document in Word 2007 again. Word 2007 detects that Word 2003 has messed with some of its registry keys and launches a self-repair operation which literally takes more than a minute and uses all available CPU.

    Selfish indeed.

  59. Anonymous says:

    We got it all in these comments.  A plainly worded informative article that nobody bothered to read until the end, and worthless complaints from Mr. Diamond that added nothing to the discourse.

    I’m glad my Windows systems never have the same problems his does.  I extensively used my laptop last night, and it just went into some form of sleeping when I closed the lid.  Then it just woke up when I opened it.  I also had a USB drive in with ReadyBoost on when I was working, but my girlfriend took it out, then opened the lid and switched users.

    Everything just worked. <shrug>

  60. Anonymous says:

    Seems an awful lot of aversion to what is a great step forward…

    On my laptop via the power options I can configure what I want to do based on closing the lid, pressing the sleep button or pressing the power button – both the button choices are set to ask me what to do, Closing the lid hibernates (I rarely close the lid by accident but often catch the poorly positioned sleep button) – if I do close the lid when burning a CD / DVD I only have myself to blame if something goes wrong with the process. Even so a duff CD / DVD it is still a better situation than getting home after a 40 minute train journey to find the laptop still on and slowly cooking itself to death.

    People also seem to be complaining about applications that are communicating in some way (automation being one example) – if the applications are on the same PC then they get hibernated together, they wake up together and they are ignorant of what has happened due to the actual process being transparent to them, for the majority of applications the need to even be aware that the PC has been to sleep / hibernated is a non-issue. If the applications were on different machines then it is probably going to fail regardless as I’m probably taking the laptop to a different location anyway.

  61. Anonymous says:

    DriverDude, Steve, ChrisMcB,

    Yes, apps should deal with files/devices just "going away" underneath them as best they can, and shouldn’t have to actually do anything w.r.t. a suspend/resume; it should be totally transparent to them.

    *But* – if MSDN says that your app gets 2 seconds to deal with a standby notification event, but it’s possible for the kernel to not give you *any* CPU time during that 2 seconds due to it servicing the requests of other apps that are, what’s the point in the 2-second wait?

    Why not just say that you do get a notification of the power change, but not guarantee when – you might not get the notification (or at least not be able to process the notification, which is effectively the same thing as far as the process is concerned) until after the computer has already resumed.

    It’s not the actual standby behaviour I’m that concerned about, I’m sure the MS engineers can make good decisions on what behaviour is appropriate. It’s how it’s being documented and presented to developers that concerns me. Don’t guarantee me something and then fail to deliver. Don’t tell me I have 2 seconds to respond to something if I don’t. If you tell me I can’t do anything on a standby notification, and that I might only get to process it after the computer has resumed, I can work with that. That’s fine. Just so long as I know what could happen.

    How you are expected to write one of these bulletproof never-lose-any-data apps without knowing what behaviour you’re going to get from the OS when unusual things do happen is beyond me.

  62. Anonymous says:

    "That said, we also want to give customers a fallback for critical pre-Windows Vista applications that break under the new model. They will be able to set a power option that restores the veto capability"

    That was the one part that worried me – I rather hope that we can safely assume there is no programmatic way to enable that. I think they WOULD make it so there was no easy hack for it, because otherwise that would break the whole point of "taking the ball away"… time will tell on that score I guess. What will count isn’t whether there are hacks – it’s whether they get patched fairly quickly once they get discovered.

    However there are other ways that bad programs might be able to get around it, which are *legal* – "We can’t enable the “idle to sleep” feature on desktop PCs without a reliable mechanism for waking them back up based on scheduled tasks or network activity."

    So, possibly can programatically schedule wakeup tasks to run every second.

    My hope though, is that there is a big differentiating line between "system-driven idle to sleep" and "user-driven close the lid to sleep". I seem to remember in earlier discussions that they planned to.

  63. Anonymous says:

    Tuesday, April 17, 2007 10:35 AM by C Gomez

    I’m glad my Windows systems never have the

    same problems his does.

    s/does/do/

    I’m glad for you too.  (This isn’t sarcasm.  I wish I knew what makes the difference and I would gladly copy it.)

  64. DWalker59 says:

    Wow.  As soon as I posted here, I saw that "Leave a Comment" on that other blog suddenly appeared for the September 2005 entry.  There was no such button yesterday!

    I still predict that the blog is defunct.  We’ll see!

  65. DWalker says:

    Raymond says "If you have questions about the future of power management, you probably should ask the power management folks over on the Windows Mobile PC Team Blog."

    That blog is defunct.  There are a total of 7 posts in its entire lifetime, and none are after November 2005.

    Furthermore, there is *no way* to contact those folks (as far as I can tell).

    It’s great when you give us other resources — since some of us realize that you’e not the expert on everything — but in this case, that resource doesn’t really exist.

  66. Anonymous says:

    I spent 30 minutes today trying to find out how to change the gd* shutdown button so it actually SHUTS DOWN instead of falling asleep and crashing into a telephone pole. Without Google, I’d still be looking.

    For those of you who don’t have Vista: where would you look for an option to change the effect of a shutdown button on the start menu?

    • Right-clicking on the button;
    • Taskbar properties;

    • User account settings?

    • Hell, folder options??

    Wrong. The correct option, as the Windows User Experience team decided, is the Advanced button on the Power Management control panel.

    I’m not bitter.

    By the way, I’d gladly use the default sleep option if it didn’t cause Vista to hang on a black screen. But that’s to be expected; this computer is well over four weeks old.

    Sorry, I’m just ranting.

  67. Anonymous says:

    Blah, blah, blah…

    How about this:

    You work on your new fantastic 3D model in Poser 7, highly detailed geometry and tons of textures, and your scene is so complex that the scene file is ~300MB in size. Then you accidentally hit Suspend on a keyboard. And bang, in two seconds your computer is in S3 state.

    You say "Damn, good thing that S3 Suspend/Resume works reliably in Vista" and reach for power button to bring it back on. And you get black screen because you have NVIDIA 8800 GTX/GTS video card and older drivers with broken power management. Or your video works fine but your mouse and keyboard don’t, so you are stuck without a chance to save your work.

    Another version would be — you accidentally hit Shutdown and since 2 seconds are not enough to save 300MB yet even on fastest desktop drives you again lose your work but this time completely since the original file is partially overwritten and corrupted beyond repair.

    I agree that applications should not have a veto on power management because they are usually not as well informed as the OS itself of the current power situation. But, IMO it would be much better to allow user to grant a vetoing right to certain apps he values more than a dead battery.

  68. Anonymous says:

    We really need two things:

    (1) Options to disable whatever the Suspend key or Shutdown key is, or maybe options to ask for confirmation when they’re pressed.  Disabling would be similar to the way some gamers disable some of the keys near Ctrl and Alt.

    (2) Options to ask for confirmation when a shutdown option is selected.  Hibernation and Shutdown are so far away from each other in that menu, there’s no way that anyone other than me would slip while mousing, but still…

  69. Anonymous says:

    You know what’s funny? After all the hysterical comments in previous blog articles here about how Microsoft need to respect the end user more and just do what the end user asks them to instead of trying to be clever, they finally deliver some code that does that exactly and get flamed for, erm, respecting the end user more by doing what they ask.

    You can’t win.

Comments are closed.