Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

To sleep, perchance to dream?

29 views
Skip to first unread message

bob

unread,
Oct 31, 2012, 10:48:49 AM10/31/12
to
Do programmers actually try to ensure that their applications function correctly when the computer goes into sleep mode for 10 hours and then comes out?

Or do they just hope no one puts the computer in sleep mode while their app is running?


Robert Wessel

unread,
Oct 31, 2012, 1:46:48 PM10/31/12
to
On Wed, 31 Oct 2012 07:48:49 -0700 (PDT), bob <b...@coolfone.comze.com>
wrote:

>Do programmers actually try to ensure that their applications function correctly when the computer goes into sleep mode for 10 hours and then comes out?
>
>Or do they just hope no one puts the computer in sleep mode while their app is running?


Sure. Testing behavior during sleep/hibernate functions is a normal
part of release testing. If the applications requires special
handling for those, or can't support sleep/hibernate at all, the
system provides functions for dealing with that. For example, in
Windows, you can register to be notified of a pending power state
change with a WM_POWERBROADCAST message , and you can tell the system
that a thread can/cannot be suspended with SetThreadExecutionState()
(post-XP, the power management stuff is a bit different in XP*).


*In XP you can respond "no" to the WM_POWERBROADCAST, and while that's
still supported in Vista/Win7/Win8, it's not the preferred approach.

Pascal J. Bourguignon

unread,
Nov 2, 2012, 11:16:26 PM11/2/12
to

Mensanator

unread,
Nov 3, 2012, 12:45:51 AM11/3/12
to
On Wednesday, October 31, 2012 9:48:50 AM UTC-5, bob wrote:
> Do programmers actually try to ensure that their applications function correctly when the computer goes into sleep mode for 10 hours and then comes out?
>
>
>
> Or do they just hope no one puts the computer in sleep mode while their app is running?

Ha! I had a programmer give me code for testing that he never even bothered to run after compiling.

When I asked why. he said: "I don't have to run it,
I know how it works. I wrote it."
I said: "Because you wrote it. you only THINK you know
how it works. In fact, it doesn't even run. It crashes immediately
on startup."
Given that attitude, what would you guess the answer to your question is?

Wally W.

unread,
Nov 3, 2012, 9:52:39 AM11/3/12
to
Interesting.

Why is this one a falsehood?
http://infiniteundo.com/post/25509354022/more-falsehoods-programmers-believe-about-time-wisdom
7. Months have either 28, 29, 30, or 31 days.


How can a month have some other number of days?


Pascal J. Bourguignon

unread,
Nov 3, 2012, 11:26:38 AM11/3/12
to
Wally W. <ww8...@aim.com> writes:

> 7. Months have either 28, 29, 30, or 31 days.
>
>
> How can a month have some other number of days?

When thre is a change of calendar i the iddle of a month.
Or when it is not a "month" based on the Moon.

For example, wikipedia says:

Spain,[19] Portugal, the Polish-Lithuanian Commonwealth, and most of
Italy implemented the new calendar on Friday, 15 October 1582,
immediately following Julian Thursday, 4 October 1582.

So the month of October 1582 in those countries had only 20 days!

--
__Pascal Bourguignon__

Wally W.

unread,
Nov 3, 2012, 4:22:09 PM11/3/12
to
Aha.

Thanks.

Robert Miles

unread,
Nov 4, 2012, 1:17:42 AM11/4/12
to
On 10/31/2012 9:48 AM, bob wrote:
> Do programmers actually try to ensure that their applications function correctly when the computer goes into sleep mode for 10 hours and then comes out?
>
> Or do they just hope no one puts the computer in sleep mode while their app is running?
>
>

Some do, some don't. For BOINC applications without checkpoints, that's
about the only way to allow shutting down the computer. I've seen some
such BOINC that need to run for a month or more, not counting any time
the computer is in sleep mode.
0 new messages