What is the real effect of calling performSelectorInBackground:...from a method that runs in the background? I want it to run asynchronously
For instance:
- (void) _imageBufferWasUpdated{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if(shouldContinue){
[self performSelectorInBackground:@selector(_loop) withObject:nil];
}
[pool release];
}
_imageBufferWasUpdated will execute in the background, and I want to call the _loop method asynchronously (in the background also _imageBufferWasUpdated will end soon, probably before _loop finishes).
Is it correct?
Is there a more efficient (and relatively simple) way to do this with a GCD? I would appreciate it if you could give an example on how to do this using GCD. It seems to me that I need at least 3 threads, the main thread, the background thread to run _imageBufferWasUpdated, and another background thread for _loop. Am I right?
Thanks in advance Ignacio