From: Apple docs on managing concurrency:
NsOperation
Write a custom subclass and override one method: main. The main method gets called to perform the operation when the NSOperationQueue schedules it to run. NSOperation classes written in this way are known as non-concurrent operations, because the developer is not responsible for spawning threads—multi-threading is all handled by the super class. (Don’t be confused by the terminology: just because an operation is non-concurrent, does not mean it cannot be executed concurrently, it simply means that you don’t have to handle the concurrency yourself.)
I think overriding main is the easiest way to use NSOperation, but the apple site says its non-concurrent does it mean that the nsoperations in the nsoperation queue(when only overriding main) would execute serially?
I don’t want to execute my operations serially, but I want to get my operations parallel with as minimum effort as possible.
No, they will not necessarily be run serially. Just as the paragraph you quoted noted, it “does not mean it cannot be executed concurrently”.
So what does determine if they can run in parallel? The
NSOperationQueueand any dependencies you set up between the ops. A little later in that same document, the section entitled “Running Operations” explains:And in the Concurrency Programming Guide it elaborates:
What you do give up by using non-concurrent operations is that the operation itself isn’t intended to set up new threads, etc.