News for hackers. Stuff that matters.
Re:How multitasking really works on Android and iOS by masklinn on Thursday January 05, 2012 @12:35PM (#3429575)
The iOS description is lacking, to say the least.

> When an iOS user hits the home button, an Active app moves to Background.

Not entirely correct, this is only for "multitasking-aware" applications: 1. applications linked against the iPhoneOS3 SDK are not multitasking-aware; 2. applications linked against the iOS4 (or 5) SDK can opt out of multitasking by setting the `UIApplicationExitsOnSuspend` key.

Multitasking-unaware applications are killed when they leave foreground, they do not get in the background and do not get suspended. They get a message `applicationWillTerminate:` and are then killed.

> If the device needs more memory for a game or other large app, Suspended apps will be cleared from RAM.

Incomplete, all non-foreground applications can be terminated and cleared when the device is low on memory. The difference is priority, suspended applications will be killed first (they're just cleared from RAM), then backgrounded (but running) applications will be terminated if the device still needs to reclaim memory.

> Apps are only allowed to remain Background tasks and run code for longer than a few seconds in specific circumstances

That's not quite true, Apple provides specific "infinitely-running" services (location, GPS or cell; VOIP; music playing; as well as a local notification system which allows applications to wake themselves up) but it also provides a service called "Task Completion" which lets applications do whatever they want for up to 10 minutes. Task completion has no "specific circumstances".

Re:How multitasking really works on Android and iOS by cma on Thursday January 05, 2012 @04:40PM (#3430650)
>they're just cleared from RAM

Don't various sockets, file descriptors, and related buffers get freed as well?

Re:How multitasking really works on Android and iOS by masklinn on Saturday January 07, 2012 @09:03AM (#3437014)
As far as I know, that happens automatically when the process owning them is killed. A suspended application is conceptually a process with priority 0