Mobile Multitasking

Wednesday, 14 April 2010

Daniel Eran Dilger at Apple Insider:

Other platforms have enabled multitasking by simply allowing any number of apps to run. This results in a mess for users because it’s up to them to manage which apps are running out of control or needlessly chewing up resources in the background. Android and Windows Mobile are both notorious for needing TasKiller or some other sort of manual process manager to keep battery life and performance in check.

I believe he’s right about Windows Mobile, but that’s no matter because Microsoft has abandoned Windows Mobile, and Windows Phone 7 will apparently ship with no multitasking, and, whenever multitasking eventually does appear in Windows Phone, it won’t be like that. But Dilger is flat-out wrong about Android. Shooting fish in a barrel, I know, but I think it’s worth clarifying this. If you want to understand the current mobile landscape, it’s essential to understand that, in broad terms, what Apple has unveiled for iPhone OS 4 is pretty similar to Android’s multitasking model. In both iPhone OS 4 and Android, users should never need to quit apps manually — when the system runs low on memory, it automatically quits least-recently-used background apps to free up more.

Now, it’s true that there are task manager apps in the Android Market. But they are not necessary. The Android system doesn’t come with one and doesn’t need one. And I strongly suspect that Google’s Android team is annoyed that these task manager apps are in the market, because their existence creates the impression that they’re necessary or useful. I’ve spent a few weeks on a Nexus One, and background apps don’t slow the system down and don’t need to be quit manually.

There are a lot of things I like better about the iPhone than Android. The multitasking architecture, however, has been an Android advantage, and iPhone OS 4, I think, will pretty much put them on equal footing in this regard. There are technical differences, but they’re small differences, not big ones.

On both Android and iPhone OS 4, non-frontmost apps can run, but in limited fashions, in the background. It’s not like on Mac OS X or Windows where background apps continue to run exactly as though they’re in the foreground. On iPhone OS 4, apps in the background — those that support “fast application switching” in Apple’s parlance — are effectively paused. They’re still in RAM, but they can’t get large amounts of CPU time. What they can do, though, is use a limited number of APIs from the system to perform certain tasks — the two examples so far are play audio (Pandora) and receive/maintain VOIP calls (Skype).

One can argue about which platform, Android or iPhone OS 4, has the better multitasking system. Maybe Android’s system is still better; my hunch is that Android allows background apps more freedom. Maybe the iPhone’s system is better; there are some fascinating technical details, like how blocks and Grand Central Dispatch are now available for concurrent and background tasks. (Whatever you think of iPhone OS 4’s multitasking model, don’t make the mistake of thinking it’s simple; this is state of the art computer science.)1 In the end, I suspect opinion on the differences between Android and iPhone multitasking will fall along the same lines of the general question of Android-vs.-iPhone — Android offers a bit more freedom to developers, iPhone is more controlled and orderly, and tries to guarantee a more responsive system for the user.

But the differences in multitasking between the two are arguments about fine details, not the big picture.