High-Level Analysis of iPhone OS 4.0 Multitasking
Apple recently announced iPhone OS 4.0 enabling “multitasking” of a sorts. I want to dig slightly deeper into understanding what they actually mean by this “multitasking”, without talking too much about the nitty gritty details.
There are 7 kinds of “services” they expose for multitasking:
- Background Audio
- Voice over IP
- Background Location
- Push Notifications
- Local Notifications
- Task Completion
- Fast App Switching
Among all 7 “services” exposed, 6 of them are somewhat already available in the system itself, one way or another, with hidden APIs not exposed for public developer usage. Let’s take a look at each of them, and how they might “save battery” without “slowing down the system”.
Background Audio
The background audio is simply what the iTunes application already does, which is to play audio in the background without having the iTunes application open. This simply means they just expose what iPhone can already do to developers. This does not make any changes to slowing down the system in any way, since people have been using the iTunes application to play background music since the first iteration of the iPhone and iPod Touch. However, understand that the application does not remain open at all, only a small portion of the “application” remains streaming the music.
Voice over IP
Voice services has been around ever since the beginning of the iPhone (duh?!?) with the Phone application, running constantly in the background to “receive” calls. This, in fact, is also not a full fledged application at all, but a small part of code that “reacts” to an action by the OS (namely the voice service) to load up the application and “receive” the action to do something about it.
Background Location
Similarly with the voice service, it is simply a “reaction” or a “response” to an action that the OS has prompted, in this case, your GPS or Wifi location based services. This is probably one of the things that will drain your battery pretty quickly, since these services do take a lot of resources. However, since the control lies with the OS of how and when to serve up this reaction and NOT the application that decides to take over your entire GPS and Wifi location based services into their hands and drain your battery dry, the OS will probably have some battery consideration when location is required, hopefully not letting the application go rogue.
Push Notifications
What can I say? It’s been done, and been available since the last iPhone OS 3.0 release. I think it’s just put here for good measure. Once again, it is a “reaction” and not true multitasking.
Local Notifications
This is simply the same thing as your “scheduled task” or “timer” for those familiar with the terminologies. This, too, isn’t having your entire application open, but simply just a small part of it that you register to a scheduler to run it when required.
Task Completion
This is slightly interesting because it isn’t a “reaction” to something, but letting a “thread”, “process”, or keeping with this post’s terminology “a small part of the app” running in the background, and when that finishes it just automatically closes the application. This has potential for having a rogue application that simply just continuously have an infinite loop to keep the application open. I’m curious to find out how much is exposed, or only certain services like “downloading” and “uploading” are available.
Fast App Switching
This is ALSO not true multitasking, where the application once lost focus will save its state, close itself, and not “run” at all. Only after reopening, the state is restored, and the application is once resumed again. So in fact, anything running will have to be resumed, for example connection to the internet and so on. This means that it does not actually continue to run at all. However, with what was covered in the previous 6 ways of multitasking, you can very well achieve seamless “multitasking” with “Task Completion”, “Local Notifications” and so on.
Summary
What does this all mean? Steve Jobs has redefined what multitasking actually means and converted the meaning to a consumer terminology. Consumers do not want true multitasking, but a pseudo-version of it with all the benefits of multitasking, and also the benefits of a fast and responsive OS. But does this mean that developers will have more to worry about, trying to work around what’s available to them to create a seamless so-called “multitasking” application? Most of what Apple has announced isn’t anything new at all to the iPhone OS, it is simply just exposing it with a tight grip, disallowing developers to go rogue.
Do note that all this right now is speculation based on what makes sense to me until I actually see the SDK.
Source: JustinLee.SG – High-Level Analysis of iPhone OS 4.0 Multitasking

Very well summarized Justin!.
For the Task Completion, I would be interested to see what type of tasks are allowed to complete in the background. I am sure it’d be pretty restricted (they surely won’t let you complete a recursive task in the background). They will definitely have time-outs as well. So I don’t see infinite loops as an issue.
Hey Justin great round up there. Like the portion on SJ redefining multi-tasking, and may I add it’s truly mobile multitasking since our attention span on these mobile devices is shorter; hence we might not need programs to run full blown simutaneously. By the way would you guys be covering an iPad review/unbox?
Hahaha… Stay tuned to our twitter account
We have something up our sleeves
Thanks Alan. That’s true. But I’m very sure most multi-tasking can be done without the true sense of what we computer scientists define multi-tasking as.
Well, if someone would like to loan us their iPad, we can review/unbox it soon enough.
But yeah, like Daniel said, we *might* have something up our sleeves. Just follow our twitter account @tech65.
Hey I have an ipad and had been using for 2 weeks now… we can sit down for a quick review if you guys wanna. Shifting house this week though… buzz me if you guys want a see/look. Cheers