I’ve been receiving some questions from Avanade employees and people on twitter about how multi-tasking works on Windows Phone 7. Since this is also one of the topics I skipped over in my presentation at Nordtech, I’ll cover it here.
What is Multitasking?
In the classical sense, multitasking is when two or more processes run on the same cpu, gpu or other computer resource. However, with mobile devices, this notion must be clarified. When we talk about multitasking on a mobile device, what do we really mean? Since we are using our applications one at a time, all the time switching quickly between them, this can’t be the same as for computers? I would say that a device which allows me to switch instantly between running processes and can deliver content to me even though it’s not active could be considered to multi-task.
WP7 Smart Multitasking
Windows Phone 7 addresses multitasking in two different ways; lifecycle management and push notifications. The results of which are much longer battery life, more available resources at any one time and the experience of multitasking.
Each process on a phone can get interrupted at any time by incoming calls, by the user pressing HOME on the device or the user being taken to another application. The natural way to handle this is to suspend the app and resume it when the user returns to it, letting it run on low resources. This is the classic way to multi-task on your mobile devices today.
Windows Phone 7 does all this, but also something else. Imagine I’ve started 30 apps, and I start a 31st application. This might make the RAM on my phone be spread a little thin, or the processor have to juggle too many processes at once. WP7 then kills off one suspended process to give back its resources. The Pause and Resume events which you see above allows developers to handle events with save state and load state actions. In this way, RAM is always available and the user never knows his programs might’ve been shut down in between.
Without going in too deep on how Push really works, it’s a service that allows any application to listen to events online and send updated information to any subscribed WP7 device without claiming any battery. This means that instead of your phone pinging Facebook, twitter, MySpace, Hotmail or ESPN constantly asking for updates, any new content in any area your applications concern themselves with are pushed to your phone instead. This works very well and since all the work is being done by servers, your phone can listen in on any number of channels without losing any battery.
Why it’s not “real” multitasking
The one thing third-party applications lack on WP7 is background processing. This means that whenever an application isn’t visible on the screen, it can’t run code on your device. It can still use push notifications and this is enough for most applications. What it won’t help are applications like Skype, Spotify and GPS-triggered applications. The standard hubs on the phone can still do background processing though, so email, xbox live, calendar and music works just fine.
WP7 fulfills my criteria for multitasking and does so in a very intelligent way. The combination of lifecycle management and push notifications are a great way to preserve resources and energy, which is something other mobile devices are struggling with. It’s regrettable we don’t see background processing yet, but I’m sure this platform hasn’t shown us everything it’s capable of yet.