Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > What does OS X do when it sleeps?

What does OS X do when it sleeps?
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Nov 22, 2001, 11:42 PM
 
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
Reply With Quote
Nov 23, 2001, 06:12 AM
 
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 ]
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Nov 23, 2001, 07:36 AM
 
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
Reply With Quote
Nov 23, 2001, 11:06 PM
 
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
Reply With Quote
Nov 24, 2001, 12:30 AM
 
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.
     
JBL
Junior Member
Join Date: Sep 2000
Status: Offline
Reply With Quote
Nov 25, 2001, 09:33 AM
 
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
Reply With Quote
Nov 26, 2001, 12:10 AM
 
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
Reply With Quote
Nov 27, 2001, 08:28 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:15 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2