Skip navigation.
 
mlRe: Concurrent NSOperation
FROM : Hsu
DATE : Thu Nov 22 01:07:34 2007

> I'm writing an NSOperation subclass which completes it's work 
> asynchronously. As such I'm going to have to write a concurrent 
> operation.


That's not the way it works. For NSOperations, "concurrent" means 
"I'll provide the thread", not "synchronous". From the NSOperation docs:

"In the context of an NSOperation object, the terms concurrent and non-
concurrent do not necessarily refer to the side-by-side execution of 
threads. Instead, a non-concurrent operation is one that executes 
using the environment that is provided for it while a concurrent 
operation is responsible for setting up its own execution environment."

followed by

"For a non-concurrent operation, an operation queue automatically 
creates a thread and calls the operation object’s start method..."


So, basically, for simple asychronous behavior just subclass 
NSOperation and override -main. NSOperationQueue will be responsible 
for creating the threading "environment", within the parameters set 
(e.g. -setMaxConcurrentOperationCount:).


Karl
>




--

If Goddess had intended humans to smoke, She would have set them on 
fire.

Homepage:
      http://homepage.mac.com/khsu/index.html

Related mailsAuthorDate
mlConcurrent NSOperation Keith Duncan Nov 21, 18:40
mlRe: Concurrent NSOperation Shawn Erickson Nov 21, 18:50
mlRe: Concurrent NSOperation Keith Duncan Nov 21, 19:57
mlRe: Concurrent NSOperation Shawn Erickson Nov 21, 20:08
mlRe: Concurrent NSOperation Keith Duncan Nov 21, 20:50
mlRe: Concurrent NSOperation Hsu Nov 22, 01:07
mlRe: Concurrent NSOperation Keith Duncan Nov 22, 12:48
mlRe: Concurrent NSOperation Chris Kane Nov 24, 23:14