Using Concurrency to Improve the Responsiveness of iPhone and iPad Applications
You do not have to have a lot of experience developing iPhone applications before you begin to realize that you may need to fetch data from a server on the Internet or that you have a CPU intensive calculation that freezes your application and prevents your user from interacting with the user interface of your application. On any platform with any computer language, the standard way of dealing with such issues is to perform these tasks in the background allowing your application’s user interface to remain responsive to a user’s interaction with your application. Fortunately, iPhone OS, like its much bigger sibling Mac OS X, provides a rich array of concurrency solutions for developers needing to use them. However, as you will see the concurrency solutions vary quite a bit in terms of their degree of complexity, level of abstraction, and scalability. This chapter is a brief survey of the concurrency solutions available and you will develop solutions with some of them. There is a definite point of view that I’ve developed by working with the iPhone SDK and trying to divine the path that Apple might take in the future that hopefully will come across. After all, whether the application is for an iPod Touch, iPhone, or an iPad it isn’t cool if the application is sluggish!
KeywordsMain Thread Head File Snow Leopard POSIX Thread Operation Object
Unable to display preview. Download preview PDF.