Concurrency Master Data (NSOperation)

Apple docs says:

... you must create a context in main (for a sequential queue) or start (for a parallel queue).

But I really don't understand what the difference is. Why can't I create context in mainfor a parallel queue? I tried this and it works exactly the same as if I did it in start.

There is another thing that bothers me. From the docs for the start method :

... If you implement simultaneous work, you must override this method and use it to initiate your work.

So why can't I initialize everything in main(or maybe shouldn't initialize)?

+3
source share
2 answers

There may be a difference between what you call “context” and “parallel,” and what Apple means in terms. They use a "parallel" specific (and confusing) method. This section of Controlling Concurrency using NSOperation can help:

NSOperation, : main. , NSOperationQueue . NSOperation, , , . . ( : , , , , , Concurrency.)

, . NSOperation . . NSOperation, , isExecuting isFinished. , , - .

+5

, main() , , , start(), .

+2

All Articles