In that case the system will just ask, if sleep is okay. The difference between "Is it okay to sleep" and "I'm planing on going to sleep" is: The first one is sent if the power saving settings are applied, that is, if the user has not moved the mouse or typed anything for the time configured there. However, you can also listen to an event, where the system asks apps, if it is okay to go to sleep now and there you can reply "no", causing a sleep to be canceled. If the system already decided it will go to sleep, you can only suspend this by at most 30 seconds or allow it at once, you cannot cancel it. And finally, you can cancel it though not all events can be canceled. Another one is to suspend sleep however, Apple says certain events can be suspended at most 30 seconds, after that, the system will just continue, whether your app likes it or not. One is to reply to it, that the system may progress. In that case, your app will receive an event, when the system wants to go to sleep. You can open a kernel port and register for sleep/wake-up events. funnels), the kernel may suspend sleep till this call returns back to user space or execution reaches such a safe-point before it finally cancels your app from the task scheduler. sleeping, waiting for a condition to become true, etc.) or possibly holding critical kernel locks (e.g. That means if you just made a call into the kernel (many libC functions do) and this call is not at some safe-point (e.g. However, the kernel must be in a clean state. Once the system really goes to sleep, the scheduler simply gives no time to your app any longer, thus it will stop execution wherever it is at that moment, which can happen pretty much everywhere. Your app constantly gets execution time by the task scheduler, that decides which app gets CPU time, on which core, and for how long. Your app is interrupted exactly where it is that moment if the CPU is actually currently executing code of your app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |