Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Would a scheduled Java app run when Windows is in sleep mode?

If I start a Java app, it initiates and does some work then goes to thread sleep for an hour, then wake up after an hour and does some more work ...

But my PC is running Win7 and after 15 minutes of inactivity, it will go into sleep mode, so my question is : an hour from I started the Java app, if I don't touch the PC, and it goes into sleep mode, will my Java app still be able to wake up and do its work, and if so will the Win7 PC wake up with the screen turned on again [ because in Win7 sleep mode the screen turns off ] ?

like image 386
Frank Avatar asked Oct 18 '10 14:10

Frank


1 Answers

A normal Thread.sleep() will not wake up the computer from sleep mode.

However, when registering a task with the Windows task scheduler, you can choose "wake the computer to run this task". When going to sleep mode, Windows will tell the motherboard the time of the next registered wake-up task.

like image 139
Daniel Avatar answered Oct 16 '22 14:10

Daniel