 |
 |
What does OS X do when it sleeps?
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Just kind of curious, but what actually happens when OS X goes to sleep? I'm guessing every thread is sent some type of a sleep command, but I was wondering what kind of stuff is still running even though my mac is sleeping. There is obviously something running that interprets that my ibook case has just opened, or I just moved my mouse. There's also a way to wake the machine for administrative access (I know timbuktu uses this). So... what exactly is still running while my machine is sleeping? And is there anyway to make threads that won't go to sleep, or to use some contrived method to use the threads that don't sleep to do stuff I want them to do while my machine is sleeping?
Thanks,
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status:
Offline
|
|
Not sure what the exact process (no pun intended) of making threads sleep is, but I'm guessing after it's told processes to block and stored register values, the CPU just shuts down.
I would think that there are a couple of non-maskable interrupt lines into the CPU which, when activated by moving the mouse or opening the iBook's lid or getting a substantial packet from the ethernet card, tell the CPU to start up again.
I'm not too hot on the hardware side of computing, my university course is predominantly software based with a fair chunk of data communications and network stuff. This thread may be better in OS X general where more people, who are less software-oriented, will look at it.
[Edit: stupid spelling/grammatical mistake]
[ 11-23-2001: Message edited by: Geobunny ]
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Depends what level of sleep you go into, if it's deep sleep then just about everything shuts down, but I think processes still run if the HD just spins down and the display shuts off.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Location: Kansas City, Mo
Status:
Offline
|
|
Whatever it is doing it really runs down my battery on my iBook combo drive. Sure comes out of it fast though.
[ 11-24-2001: Message edited by: kcmac ]
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Sep 2001
Status:
Offline
|
|
It wakes up from sleep fast because everything is done simultaneously, so instead of waiting a few seconds for AppleTalk to start again in 9, X lets other services start at the same time as AppleTalk (just an example) and you get to work faster.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Status:
Offline
|
|
It has to be doing something more than what 9.x does because it runs down the battery much faster (on a TiBook 500). Unless there is some magic way to put it in deeper sleep that I don't know about, that is (I just use "Sleep" under the Apple Menu).
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2000
Location: Los Angeles, CA, USA
Status:
Offline
|
|
I think that it actually turns off the CPU and the hard drive and the monitor and what not, but keeps the RAM alive by refreshing it (thus using lots of power). This means that when you wake it up, it doesn't have to load much from the HD which is why it's almost instantly there... under MacOS 9 maybe it writes the RAM to the hard drive then shuts it all off. Just a thought, but refreshing the RAM could really explain the power usage while asleep.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Cupertino, CA
Status:
Offline
|
|
Originally posted by Ghoser777:
<STRONG>Just kind of curious, but what actually happens when OS X goes to sleep? I'm guessing every thread is sent some type of a sleep command, but I was wondering what kind of stuff is still running even though my mac is sleeping. There is obviously something running that interprets that my ibook case has just opened, or I just moved my mouse. There's also a way to wake the machine for administrative access (I know timbuktu uses this). So... what exactly is still running while my machine is sleeping? And is there anyway to make threads that won't go to sleep, or to use some contrived method to use the threads that don't sleep to do stuff I want them to do while my machine is sleeping?
Thanks,
F-bacher</STRONG>
No, there is nothing running, at least not in the sense you are thinking. Also most threads do not receive any notification, if they want notification the program needs to register for it.
When the system is asleep the main CPU as well as significant portions of UniNorth and such all either in low power mode or entirely shutdown. The PMU is sitting there connected to sensors and such running an embedded program. It notices when the lid opens or a key is pressed, and then restarts the rest of the system. No operating system threads are running.
As far as waking the machine that is through a standard mechanism called wake-on-lan. You just have to send a "Magic Packet"
Louis
|
|
Louis Gerbarg
Darwin Developer
These are my views, and not the views of my employer.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|