hi Forum,
I am starting to dive into NSOperation and NSOperationQueue...and my brain is on overload right now... there are so many different options to use when using threads in iOS. But I have read the concurrent VS non-concurrent article in apple docs and for the life of me I dont get...please help... i honestly dont even know where to start but it says
my question is
Why would someone even use NSOperation for a non-concurrent op (synchronously)?? isnt the whole point of using NSOperation to use it to execute an OP in a new thread other than main ?
I am starting to dive into NSOperation and NSOperationQueue...and my brain is on overload right now... there are so many different options to use when using threads in iOS. But I have read the concurrent VS non-concurrent article in apple docs and for the life of me I dont get...please help... i honestly dont even know where to start but it says
If you plan on executing an operation object manually, instead of adding it to a queue, you can design your operation to execute in a concurrent or non-concurrent manner. Operation objects are non-concurrent by default. In a non-concurrent operation, the operations task is performed synchronouslythat is, the operation object does not create a separate thread on which to run the task. Thus, when you call the start method of a non-concurrent operation directly from your code, the operation executes immediately in the current thread. By the time the start method of such an object returns control to the caller, the task itself is complete.
In contrast to a non-concurrent operation, which runs synchronously, a concurrent operation runs asynchronously. In other words, when you call the start method of a concurrent operation, that method could return before the corresponding task is completed. This might happen because the operation object created a new thread to execute the task or because the operation called an asynchronous function. It does not actually matter if the operation is ongoing when control returns to the caller, only that it could be ongoing.
my question is
Why would someone even use NSOperation for a non-concurrent op (synchronously)?? isnt the whole point of using NSOperation to use it to execute an OP in a new thread other than main ?