views:

929

answers:

3

Apple introduced Grand Central Dispatch (a thread pool) in Snow Leopard, but haven't gone into why one should use it over OpenMP, which is cross-platform and also works on Leopard. They're both pretty easy to use and look similar in capability. So, any ideas?

A: 

Performance and OS Level Integration?

Justin Niessner
+5  A: 

GCD is much better at runtime evaluation of the appropriate level of resources to throw at a problem - OpenMP decides how many threads to invoke for a set of parallel tasks based on information like environment variables. GCD looks at the current system load and number of available cores and allows an appropriate number of threads to run - scaling up and back as the resource usage changes in real time. That means that a GCD program ought to get better results in the general case. Of course, if you've bought a cluster of dedicated boxes to run your code, then this is moot because there will be little else for your code to conflict with.

Graham Lee
+1  A: 

Now that GCD has been open sourced, it's a matter of putting both tools side by side and see who lives in the end.

Valmir Pimenta