Live data from Hacker News

Mobile Multitasking

daringfireball.net

21–30 of 68 posts

Re: Mobile Multitasking

#21

What's the link between blocks/grand central and multitasking on the iPhone?

It sounds like Grand Central is the mechanism through which multitasking roles are described/created; i.e. programmers declare the background parts of their app as closures (GCD blocks) which are handed off to a task manager.

I might be wrong on this.

Re: Mobile Multitasking

#22
You certainly do need a task manager on Android for the simple reason that certain types of applications can be battery hogs. They may not tax the performance of the device enough to be killed automatically. I know Android 2.x is supposed to monitor battery usage but it simply doesn't work very well -- or at all in some cases. Subsonic (streaming audio client) kills my phone's battery if I don't kill it manually with a task manager. The app does not include a quit option. It can kill my battery in about 3 hours even if I pause playback because it keeps its connection to the server open. Another app I use, Jabiru (jabber client), does the same thing but it does have a disconnect and quit option so I wouldn't need a third party task manager to deal with it. So it seems to me Android's multi-tasking is largely dependent on the applications you use.

Re: Mobile Multitasking

#23
post #11
post #6

Earlier quoted context omitted.

When an app is swapped to disk, all it's code and data pages are stored. When it's resumed, the code and data pages are loaded back. This isn't so terribly different from relaunching the application (loading the code) and having the app restore it's state (loading the data). In fact, the app can even be more efficient in saving it's own state because it can discard anything it knows it doesn't need. Paging is really…

Paging is a technique to free up RAM. Whether its used to enable interaction with multiple apps, to allow a single app access to more memory than physically exists, or to allow more apps to be frozen in the background is irrelevant. It is neither better nor worse than the system Apple has designed. Its just different. And yes, an app can manually attempt to restore it's state but a) doing so can be quite tricky (keyb…

Of course, then you have to deal with resources – like when you unfreeze your app partway through typing a word, but in the meantime the user has changed keyboard layouts, or you unfreeze the camera program but meanwhile something else has been using the camera and left it in a different state.

Better to persist as little as you need, and deal with everything else through clearly defined lifecycles, IMO. Although, I also think programming languages should provide immutable datatypes by default ;).

Re: Mobile Multitasking

#24
These Android/iPhone apps architecture is very close to web page approach. In web environment, you can load the page, interact with page, you can close it anytime a do something else. Traditional application were different but these modern mobile apps do the same - you open app like page, you navigate somewhere else and OS close app automatically. Some apps are using cloud data but some can use local storage.

Its so close to web architecture, that we can see Chrome browser on the other side - it's architecture is making step towards applications by using processes for loaded web pages. Both architectures are closing - apps are more like web pages and web pages are more like apps ...

Re: Mobile Multitasking

#25
post #18

I'm glad he made this point, but he's still not giving Android enough credit. With Android, apps can create a service that can run and do whatever it likes. It's not limited to a couple APIs. People are pretty jazzed about Skype running in the background, but they are going to be dissapointed when they realize that only means that you can keep the current call running while you leave the app. Skype still won't be abl…

Do you get acceptable battery life running an IRC client in the background? The client has to keep a persistent data connection open and will be constantly transferring data. I've not had much luck with IM clients on BlackBerry, WebOS or Android. I guess the bigger question is if the user's battery should be drained in a situation where they don't understand the ramifications of what they're doing. If you're playing a 3D game for an hour you're focused on the screen and can watch the battery meter go down. If you open the IRC client, forget about it, pocket the phone, and a few hours later fall down with a heart attack -- unable to call 911 that's a different issue entirely.

I think some companies do take that ethical consideration very seriously. The company I work for provides a digital phone service with E911 and our corporate culture has definitely changed since this service launched. The possibility of interrupting a customer's service even for a few minutes in the middle of the night makes me uncomfortable. There's always that possibility someone will be reaching for the phone to call 911 and you definitely don't want to be responsible for playing any role in preventing it.

Re: Mobile Multitasking

#26
Moore's law seems to be in full effect for handsets. I think a lot of the innovation here is a stop gap measure before these handsets have virtual memory, making the complication behind multi tasking obsolete.

On a side note, I seem to take heat every time I imply that phones will end up on par with PCs. The common theme I've been pushing is that most of the developments we've seen in PCs over the past decade will reoccur for phones. Is this really so far fetched?

Re: Mobile Multitasking

#27
post #23
post #11

Earlier quoted context omitted.

Paging is a technique to free up RAM. Whether its used to enable interaction with multiple apps, to allow a single app access to more memory than physically exists, or to allow more apps to be frozen in the background is irrelevant. It is neither better nor worse than the system Apple has designed. Its just different. And yes, an app can manually attempt to restore it's state but a) doing so can be quite tricky (keyb…

Of course, then you have to deal with resources – like when you unfreeze your app partway through typing a word, but in the meantime the user has changed keyboard layouts, or you unfreeze the camera program but meanwhile something else has been using the camera and left it in a different state. Better to persist as little as you need, and deal with everything else through clearly defined lifecycles, IMO. Although, I…

Good points - except that under iPhone OS 4.0 the OS and apps already have to handle these situations.

Apps compiled for 4.0 are "frozen" when backgrounded. When they are brought to the front, either from the new task pane or their icon, they are unfrozen and restored to a running state. If the iPhone becomes low on memory it terminates frozen apps from least to most recently used.

So since these apps are already suspended, and must deal with a degree of state change when restored, I'm curious why the OS doesn't/can't page their backing store out to flash memory.

Re: Mobile Multitasking

#28
post #18

I'm glad he made this point, but he's still not giving Android enough credit. With Android, apps can create a service that can run and do whatever it likes. It's not limited to a couple APIs. People are pretty jazzed about Skype running in the background, but they are going to be dissapointed when they realize that only means that you can keep the current call running while you leave the app. Skype still won't be abl…

cpr and swernli are correct: Skype can "listen" for incoming calls.

This is demoed by Skype's head of product development, David Ponsford around 00:22:20 in the video of the iPhone OS 4 Event: http://events.apple.com.edgesuite.net/1004fk8d5gt/event/ (I personally found most of the event rather interesting, if you have about an hour to spare.)

Post reply on HN