You are here

How well do our Apps handle Standby / Hibernate?

8 posts / 0 new
Last post
Simeon
Simeon's picture
Offline
Last seen: 10 years 6 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
How well do our Apps handle Standby / Hibernate?

The subject says it all: How well do our Apps handle Standby / Hibernate?

I just responded to someone in the german forum. He woke up his PC from hibernate with Thunderbird Portable still running and it downloaded all his messages again (~1000) He killed Thunderbird, got several windows errors in the process and now his SD card is unreadable.

This made ma aware of the problem that I don't know what happens in hibernate with our Apps. What if the app is woken up before the launcher starts? Has anyone ever considered this problem when coding a launcher?

I never use Hibernate/Standby so I dont know anything about it, but after thinking a bit about it I think it might be a bigger problem than I anticipated.

Comments appreciated!

wraithdu
Offline
Last seen: 11 years 10 months ago
Developer
Joined: 2007-06-27 20:22
Standby and Hibernate are

Standby and Hibernate are basically the same in that all apps stay in a 'running' state. All memory is saved and restored in Hibernate, and simply remains in memory in Standby. Barring any Windows bugs, apps *shouldn't* know anything is happening.

Now, there is a way to handle the shutdown sequence, which I've done in PFA, to handle if the computer is shutdown while the app is running. But this would be difficult to coordinate between an app and launcher, since Windows can send to the shutdown signal to apps in any order.

Jimbo
Offline
Last seen: 5 years 3 months ago
Joined: 2007-12-17 05:43
The -APPS- will be fine, but...

All of the apps should be fine, or at least as fine as their non-portable versions.

However, the external drive will be shutdown / disconnected / deactivated, which means that any open files on it can and likely will cause problems if the application wakes up and tries to work with them before the drive itself wakes up, reattaches, and restarts.

In other words, if you run them from the internal hard drive, they should be OK, but anything accessing a USB stick or memory card is probably unwise.

pj80471
Offline
Last seen: 11 years 8 months ago
Joined: 2007-03-05 11:08
The -APPS- will be fine, but...

most systems, with a running virus checker, probably won't go into that mode if a usb stick is left in. My laptops say I must eject it before it continues.
When run from hard disk I have had no problems at all, been doing so for at least a year.

Phil Jobling, UK
----------------
"search button, what search button ? doh!"

PollieXmas
Offline
Last seen: 14 years 1 week ago
Joined: 2006-05-10 16:03
My experience

I use a USB HDD.

In standby the drive light remains on and I never had any issues in XP. However I cannot recall what happened after my HP (nc 6220) restored from hibernation.

Now that I'm using Vista Business on a lenovo R500, my experience is much different. Short periods of standby is not a problem, however longer periods (when the machine goes to sleep, but still not hibernating) the machine returns in a state of chaos! Vista seems to have an additional sleep mode which XP did not have and this is what I presume is causing the problem. (Mine is set to sleep after an hour.)

Different Aps react differently, here are the ones that I know of.

1) PAM seems to close elegantly (i.e. the desktop image is restored) and can simply be restarted. However I do not know what files to check to see if it shut down normally.

2) Toucan, would return in an open state and allow you to simply continue working as if nothing happened.

3) TBP, would return in an open state, but is not functional and needs to be closed before trying to continue work.

4) FFP, would return in an open state, but is not functional and needs to be closed before trying to continue work.

I had a faulty cable and had many "unplanned" disconnects so did not pick up on the standby problem for a while, but cannot recall this being an issue with XP I only started noticing this on Vista Business. When the machine comes out of what I believe to be sleep (not hibernation) mode I can hear the notification sound that indicates that the USB drive has been disconnected and then reconnected (similar to what happened with the faulty cable).

I have now disalbed "selective suspend settings" for the USB ports and will see if this makes any difference.

Alternatively I can merely force it never to go into standby or sleep mode but it would be better if a solution can be found that would allow portable apps to continue to work even after scheduled hibernation.

Hope it helps.

Regards
Paul

Simeon
Simeon's picture
Offline
Last seen: 10 years 6 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Yes

Thanks for your comments.

It seems to me that Mozilla's Apps Portable cant do hibernate at all. I wonder what John says to this...

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 8 months ago
Developer
Joined: 2009-08-11 11:24
Not true, I think

I frequently standby/hibernate my computer with portable apps running (from the hard disk, not a flash drive, if that matters) - I've never had a problem... Firefox, Sunbird, Notepad++, GIMP, etc. etc. etc...

EDIT: After re-reading the thread, the problem appears to be that the apps "wake up" before the flash drive does, so the apps are essentially running from a nonexistent location? hmm, that is a problem...
IDEA: maybe add a part to the launchers which says "if %APPLOCATION% doesn't exist, pause the app and put up an error message"? (I don't know AutoIt or AutoHotkey or Delphi, just some VB-style languages, so I can't give a more concrete example here... sorry!)

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Jimbo
Offline
Last seen: 5 years 3 months ago
Joined: 2007-12-17 05:43
but the launcher is also on the flash drive

which means that it too is running from a non-existent location.

The way that windows memory allocation works is that paging for executable code is backed by the application file on disk, not by swapspace.

In other words, windows doesn't need to save that bit of RAM, since it knows where it got it from in the first place, and when you recover from hibernate, any of the app that was swapped out of memory will suddenly not be there until the flash drive is back online.

Also, consider that the way windows works, it might be possible for the flash drive to come back up with a different letter (for example if someone had plugged in an additional device while it was suspended).

Log in or register to post comments