Why is multitasking not supported on the iPhone?
Many people are saying that Apple has restricted it for better performance. If so Apple should increase the size of RAM to suppor开发者_Python百科t multitasking. So Apple is not allowing it. Others say that Cocoa Touch applications can't be multitasking as the iPhone has only one window and views on it.
I can not understand which is the actual reason for this ? Please clarify me.
Multitasking is supported on the iPhone. Apple's applications can run in the background. Also you can run multiple threads within the same app.
What is not allowed is 3rd party apps running in the background. Why? Frankly, no one will be able to tell you. They will be straight up guessing as it was Apple's decision to not allow this at the current moment, and Apple never gave reasons why.
Edit: Also see this video about iPhone OS myths regarding multitasking.
Because Apple doesn't trust the average iPhone app developer enough.
If you think they're wrong, I would urge you to go to the app store, look at five apps at random (not the top ones), and really think about it.
iPhone OS does supports multitasking - having multiple concurrent threads executing. What is disallowed is background processing for third party applications that do not own the view.
As Apple has not given official reasoning, the best we can do is an educated guess. The iPhone is constrained device compared to PC: it does not have MMU nor abundant secondary storage to fall back to. For everything it does you have to pay in watts from the limited capacity of battery. To create great product you have to make engineering tradeoffs.
The no-background-processing-for-apps policy constraints developers, but leads to following end user percievable benefits:
- accountability - the battery is drained by the app you are running. Users understand what running 3D games will do to their uptime. No third party app can hang in the background a do a busy waiting. This allows Apple to aggressively power down hardware components and conserve the battery life.
- responsiveness - apps launch, run and quit as quickly as possible, because the foreground app basically owns the hardware, with the OS providing services and keeping the watchful eye from behind. When the app is done, OS can free all its associated resources and get ready to serve next users request.
- stability - for the tasks that truly require background processing, like background music playback in iPod app, Apple has the source code. Those critical parts are under strictest quality control.
From where I stand, Apple's decision makes perfect sense. Even Microsoft with Windows Phone 7 Series understood this.
The Ten Myths of Apple's iPad: 9. It can't multitask is perfect video response to this question. Link via Brandon.
Because Apple Doesn't want you to? Jail broken iPhones can do multi-task no problem
I think it is purely a matter of stability, security and ease of use.
The iPhone is not a small laptop. It is first and foremost a phone which is an emergency communication device. Everything else in the function of the device is sacrificed to protect the operation of the phone. That includes things like running down the battery.
The point of iPhone design is not to make things easy for developers but to make things easy for users. Cramming to much complexity into the design usually causes more problems than it solves.
Given the iPhones tremendous success, I think Apple made the right call.
精彩评论