Background
I am a developer who is in the process of creating an application for Mac. I'm going to take on the Snow Leopard. So far I have been building on Leopard. I have been developing Cocoa for about a year not very intensively.
I read a lot about Snow Leopard and Grand Central Dispatch in particular. I know that it uses blocks, but I did not understand how blocks work or how Grand Central Dispatch works.
My question
What is the best way to develop one code base for Snow Leopard and Leopard, while maximizing the new multithreading capabilities in Snow Leopard?
NSOperationQueue
My instinct is not to deal with GCD directly in my code, but when something needs to be queued, use NSOperationQueue, as I read from Mike Ashes Q & A sessions that in Snow Leopard, NSOperationQueue is in full least takes advantage of the GCD and crasher that he discovered at Leopard are now fixed.
Manual flow control
However, when it comes to managing specific background threads, is there a way to take advantage of the thread management tools in Snow Leopard without breaking any problems in Leopard? Or do people recommend that I have different goals for each OS with several different classes in each? It would seem to me that a nightmare for service is just waiting to happen.
Or maybe I just need to live without a fully optimized application for Snow Leopard and adhering to +(void)detachNewThreadSelector:toTarget:withObject: or something like that.
What do people think?
objective-c cocoa osx-snow-leopard grand-central-dispatch
John gallagher
source share