Android A to Z: Multitasking

Multitasking is a word you'll hear a lot around here and at other places on the Internet that talk about smartphones or other tech. It doesn't mean what it used to, back when dinosaurs with long beards first dreamed up computers, but it still makes a very big difference for some folks and can be the deciding factor when picking a smartphone operating system. Let's have a look and see what the fuss is all about, and how it relates to Android.

A long time ago, in a laboratory far, far away, some Jedi masters decided that computers should do more than one thing at a time. They really already were doing plenty of things behind the scenes, but to the user it was a case of entering a command, and waiting for it to finish. Using threads and schedulers, and probably a little magic and a lot of luck, engineers were able to work up an operating system that could run more than one user command at a time, and multitasking was born. When you switch to a new VT (virtual terminal) on a Unix box with no GUI, you're multitasking. When you have more than one window open on your Windows or Mac or other computer that does have a GUI, you're multitasking. You're doing more than one thing at a time, and the computer is running more than one user task at a time. You can now read Android Central while your completely legal torrents are downloading in the background.

On a smartphone, multitasking is a bit different. We don't have the luxury of a 20-inch monitor, so showing more than one "thing" running at a time isn't a big deal. Samsung is testing the waters and trying it with the Galaxy S III with the Pop-Up Play feature, but for the most part whatever we're doing takes the whole screen to do it. We also don't have tons of RAM and video memory available and have to watch the power usage. This means smartphone multitasking has to be a bit, well, smarter. 

Smartphones have been multitasking for a long time. All the mobile operating systems do it a bit differently -- some suspending all other apps in the background, some saving the state and closing the app itself, and others just letting everything run. The way Android does it is to let threads and processes run depending on their priority. If you're using Google Play Music, the processes that make the sound come out of the speaker have a high enough priority to stay running when you switch away from the app. Not all of it is running in the background, but enough of it is to keep the tunes playing. Other apps can be killed if they aren't being used, and some apps get "frozen" (for lack of a better word) and restore themselves when brought back to the foreground. What's important, and prioritized, is decided when the application is written and compiled so the end user doesn't have to worry about it. It's not perfect, but it follows the very strong multitasking model from Linux and tweaks it for Android. It's all open-source, so manufacturers and ROM builders can (and have) tweaked things to allocate memory the way they want it allocated. Sometimes the tweaks are great, sometimes not so much. 

In the end, remember the next time you open an app and start up where you left off that you're seeing multitasking at work. 

Check out the complete Android Dictionary

More from the Android Dictionary

[block:views:article_lister_bespoke-block_13]

Jerry Hildenbrand
Senior Editor — Google Ecosystem

Jerry is an amateur woodworker and struggling shade tree mechanic. There's nothing he can't take apart, but many things he can't reassemble. You'll find him writing and speaking his loud opinion on Android Central and occasionally on Twitter.