Complex-Lifetime Operations
MandelOpper used simple-lifetime operations, meaning that -main started, ran to completion, and exited. In Mac OS X 10.5, it is a non-concurrent operation and gets its own thread.
You may have operations that do work that is asynchronous in nature, such as accessing the network or waiting for data to arrive from a radiation detector. These operations could wait in -main, or they could be implemented as complex-lifetime operations that have more control over their lifetime.
In Mac OS X 10.5, you can create concurrent operations by overriding -isConcurrent and returning YES. This tells NSOperationQueue to start the operation in the current thread. In 10.6, the operation will be started in its own thread. The Cocoa ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access