Multitasking

Apple calls its form of multitasking the “right way” to do it. I’m not totally sold on that but let’s go a little further. To switch between apps on the iOS3 you hit the home button, which takes you home, and then select your next app. Your previous app, assuming it isn’t one of a very limited list of apps that have services that can run in the background (e.g. iPod, checking email), quits completely. Switching back to the previous app relaunches it.

In iOS 4 Apple promises app level multitasking without sacrificing performance or battery life. A single push of the home button still takes you home, but a double tap will bring up a list of recently used apps along the bottom of the screen. Scroll to find the one you want to switch to, select it and you’ve just “multitasked” in iOS 4.


The task switcher in iOS 4

It works not by keeping all apps actively running in memory, but rather allowing certain features to run in the background. Developers are given access to seven services:

- Background audio
- VoIP
- Background location
- Push notifications
- Local notifications
- Task finishing
- Fast app switching

The names are mostly self explanatory. Background audio let’s an app continue to play audio in the background, while the UI and the rest of the app itself remains suspended.

The VoIP services let you receive/conduct calls outside of the associated VoIP app (so your VoIP calls can now work like regular calls over AT&T’s network).

Background location gives apps that use it access to the iPhone’s built in GPS receiver. This would allow you to continue to hear turn by turn directions from your navigation app while you’re reading email for example.

Push notifications aren’t a new addition, they enabled push notifications to your phone from 3rd party apps (e.g. Facebook telling you someone has posted on your wall while you’re not in the FB app).

Local notifications are new. If an app needs to remind you to do something it now can without having to communicate with Apple’s push notification servers.

Task finishing is the most traditional multitasking service that iOS 4 offers. You can mark a process using task finishing and that task will continue to run even after you exit an app for a finite period of time. This would allow for a chat app to continue to receive, update and log messages even when you’re not looking at what’s being said.

The final service, fast app switching, allows an application to stop/resume exactly where it left off. This is actually bigger than it sounds. Apps written for iOS 4 no longer quit when they are switched away from. Their state is saved and the app remains in memory until it is either forced closed (press and hold on an icon in the task switcher then tap the - to close the app) or the OS runs out of memory (in which case it will force an app closed). A program that properly supports fast app switching must be prepared for either case so you don’t have to worry about data loss simply because your OS ran out of memory. This also helps explain why Apple seems to have given the iPhone 4 512MB of memory and not 256MB like the rest of the iPhone/iPad lineup.


Closing an app

Remember that DRAM must be constantly refreshed to keep data active in it. This means that multitasking will still reduce battery life, but Apple is hoping by limiting the additional power draw to memory and not unnecessary CPU cycles it will be a minimal impact.

I ran some tests to see how simply playing Pandora in the background while browsing the web impacted battery life. Granted this tests not only having an application resident in memory but also pulling more data over the 3G radio, but it does show you that multitasking can and will reduce battery life:

Multitasking Impact on Battery Life
  Web Browsing Web Browsing + Pandora
iPhone 3GS (3G) 4.82 hours 3.76 hours
iPhone 3GS (WiFi) 8.83 hours 6.68 hours

Simply running Pandora in the background, which doesn’t seem like much, will give you about 75% of the battery life you’re used to while you’re doing other things. Toss in another app or two that also does something in the background and you’re looking at even more tangible reductions in battery life.

We still need faster SoCs and more power efficient platforms to make multitasking work on smartphones. I say faster SoCs because one of the best ways to improve power efficiency is to complete tasks quicker so that the CPU can return to an idle state.

Because current smartphone SoCs don’t have the level of performance needed to quickly execute a ton of extra instructions and get back to sleep, smartphone OSes have to keep background tasks to a minimum. For the most part you don’t have to worry about what applications you have open on your notebook, your CPU is efficient enough and you have enough battery power to churn through any instructions idle apps may be throwing at it. We’re not quite there yet in smartphones.

Performance is an issue and Apple is doing the right thing by making the iPhone 3GS the minimum requirement for multitasking support. Earlier ARM11 based iPhones (2G and 3G) won’t let you switch between apps, they just don’t have the horsepower to smoothly deal with some of the scenarios that could crop up.

Apple’s approach is like a set of pause buttons per app. Switching away from an app will either pause everything about that app or all but those select features that implement one of the seven services I listed above.

I’m not totally sold on it because while I agree with the underlying approach to multitasking, I was hoping for more of a significant UI change. Under the hood Apple gave developers the pause buttons to enable multitasking, but on the surface we got a cramped Alt/Cmd + Tab. I was hoping for something more...webOS-like from Apple. I do believe that Palm’s card system makes the most sense out of the smartphone OSes that are available today. I was disappointed to see that Apple couldn’t come up with something similar or innovate beyond what Palm did two years ago.

Don’t expect multitasking to work perfectly right away. The majority of existing apps are not iOS 4 optimized and thus won’t implement any of these services. Thus the benefit of multitasking won’t really be seen until we get updated apps from developers. Those that have updated their apps give you a glimpse at what the entire iPhone experience will look like in a few months.

Take Pandora for example. We can finally (finally!) have Pandora playing in the background while you’re surfing the web or doing other things with your phone. The obvious exception being making/receiving a phone call, which will automatically pause Pandora (but not resume when you’re done).


Pandora running in the background

Stability is unfortunately a problem with the new iOS 4. I wouldn’t characterize it as terrible, but thus far I’ve had more app crashes and strange problems with iOS 4 than I have had with any prior iOS release. With more applications contending for system resources and more running in the background this iOS release is going to put even more pressure on the hardware. That means more opportunities for problems to creep up and more strain on the scheduler, particularly because the iOS is still only running on a single threaded CPU.

I’ve had slowdowns, crashes and the total-system-pause that’s reminiscent of old single core desktops when an application occupied all of the OS scheduler’s time. While they aren’t the norm in iOS 4, don’t be too surprised if they happen. While many will be upgrading to iPhone 4 later this week, expect the upgrade to the first dual-core iPhones to be just as important for overall user experience in a year. There’s a good reason I’ve been ranting about SoC performance for a while now.

Folders iAds: More Significant Than You'd Think
Comments Locked

46 Comments

View All Comments

  • jigglywiggly - Tuesday, June 22, 2010 - link

    I haven't used my iphone 3g in a while. I have been using the Droid and HTC EVO 4g.

    These features have all been implemented better in Android anyway lawl.
  • Rnair - Tuesday, June 22, 2010 - link

    I wonder why the other sites are not as objective! I understand IOS 4 and its pros and cons a bit better now :).
  • medi01 - Tuesday, June 22, 2010 - link

    I could only imagine how "objective" other sites are.
    Anand's site doesn't dare to display iSomethings in a bad light. Check recent article on android devices,

    iphone is visible next to android phones, when it has advantage, but "incidentally dissapears" when it would look terrible (screen contrast).

    What a shame... :(
  • deputc26 - Tuesday, June 22, 2010 - link

    Yeah i noticed the selective presence of the iphone in that android review as well.
  • Affectionate-Bed-980 - Tuesday, June 22, 2010 - link

    You mean Anandtech only knows phones that are sold in the US? The rest of the phones fail to receive coverage. We all know how biased and limited the US cell phone market is. It only glances at part of the industry and only reveals part of the entire market. There's much more out there. Thank goodness for the N900 review, but honestly, if you want to do smartphones, do it like other sites do. Cover EVERY phone.
  • medi01 - Wednesday, June 23, 2010 - link

    No, being oriented to a particular market is ok for me.

    But showing iSomething when it has advantage (even when it is irrelevant), but "incidentally" hiding it (the author explained it like: "oh, it was probably in my pocket", that explains it, right?), when it sucks balls (contrast, for starters) is a shame.

    So it seems that we have Mr Jobbs corporation, that sells a fraction of Nokia's market share, but that enjoys free, positive or very positive but god forbid negative, coverage in press.

    I recall anand's site as rather objective (even though they seem to aggressively punch AMD quite a bit more than deserved recently, it was rather subtle, compared to what other sites do), so it's VERY frustrating, that it also bends to a Mr Apple's will.

    :(((
  • Rnair - Tuesday, June 22, 2010 - link

    I agree that the smartphone is getting more and more complicated. Good for us teck geeks :).

    But, Is it time to get back to the roots and introduce a version that is more basic, anyone for an iphone mini (an ala kin) ?
  • eirikma - Tuesday, June 22, 2010 - link

    ...then windows 95 is a cluster operating sytem. Even old versions of symbian does better than that.

    Any smart phone user who've tried using a computer knows that there are limits to how many thing you can do at once. When things stop working, you have to close down something. It is actually that simple - you don't have to "invent" absolutely everywhere.
  • SkullOne - Tuesday, June 22, 2010 - link

    Yeah but this is Apple we're talking about. If they didn't invent or improve upon it then it sucks. ;) My Droid has never run out of memory with its multitasking and I have it doing quite a bit at times.

    Apple didn't do multitasking "the right way." They did it half-assed and claim that it's magically delicious.

    All I can say is it's about time iOS finally caught up to Android...oh wait they're still behind because Android 2.2 is upon us bringing JIT compiler and Flash 10.1.

    I'll keep my rooted, overclocked Droid with Froyo ROM thanks. Hope iPhone users enjoy iAds. AdMob in apps on my old iPhone 3G drove me insane, glad my Droid doesn't have that problem. It's nice actually having control over the hardware you pay for. ;)
  • sigmatau - Tuesday, June 22, 2010 - link

    Multitasking is not at all what I expected and am very dissapointed. This is one feature I have been waiting for several months.

    I found the memory problem myself using Safari and multiple tabs. Some of the multiple tabs would dump whenever you scrolled through them, and then all of them would dump when you would switch to another app and back to Safari. I cleared out all the "multitasking" apps and opened up Safari again. I reloaded all tabs and they stayed fully loaded when I switched to a system monitor app to look at my memory.

    Before clearing out the "multitasking" apps I had 5mb of free RAM. After clearing out the "multitasking" apps, I had 125mb free. They really, really need to give you the option to chose what to multitask. Why do I need Phone, Settings, Contacts, Clock to go in the "multitasking" bar? It makes no sense. Apple is 1 year behind others in implementing multitask and it surely is not as good as the competition.

    I wont even go into being pissed that they haven't fixed the basic phone alert functions and other simple things you could do with most other free phones never mind smart phones.

Log in

Don't have an account? Sign up now