Serial Dispatch Queues

Run the sample app, and select the row called Dispatch Queue-Serial. The five initial items in the table view are visible, and they are scrollable while the long-running tasks are being processed (view the debugging console to confirm that they are being processed while scrolling the table view). After the tasks are completed, the additional rows become visible. This approach is not as fast as the Concurrent Dispatch Queue approach, but it will process the items in the order in which they are added to the queue.

To start the long-running tasks in the viewDidAppear: method, the app creates a serial dispatch queue:

dispatch_queue_t workQueue =dispatch_queue_create("com.icf.serialqueue", NULL ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.