a) Obviously OpenMP is more portable. Even on a Mac I had to use
Apple's gcc in this case
(I normally use the GNU gcc-trunk).
b) GCD does not require specifying the number of threads -- it
determines it at runtime.
c) Coding is simpler.
d) Since GCD is at a lower OS level than OpenMP, it will probably
handle resource allocation
better. But my small example, on an otherwise idle Mac Pro (16
cores, 32 GB of RAM), does
not really highlight that.
e) For more info, and some OpenMP comparisons, see
http://www.macresearch.org/cocoa-scientists-xxxi-all-aboard-grand-central
http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/12
To quote Syracuse
"Write your application as usual, but if there's any part of its
operation that can
reasonably be expected to take more than a few seconds to complete,
then for the love of Zarzycki,
get it off the main thread!"
On Sep 17, 2009, at 11:03 , Saptarshi Guha wrote:
Nice, how does this compare when using OpenMP? How does it compare when several other core hungry processes are running?( GC is supposed to nicely handle resource allocation, does OpenMP compete with the other processes?). Regards Saptarshi
=== Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of Statistics; Director: UCLA Center for Environmental Statistics (CES); Editor: Journal of Multivariate Analysis, Journal of Statistical Software; US mail: 8125 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554 phone (310)-825-9550; fax (310)-206-5658; email: deleeuw at stat.ucla.edu .mac: jdeleeuw ++++++ aim: deleeuwjan ++++++ skype: j_deleeuw homepages: http://gifi.stat.ucla.edu ++++++ http://www.cuddyvalley.org ------------------------------------------------------------------------------------------------- No matter where you go, there you are. --- Buckaroo Banzai http://gifi.stat.ucla.edu/sounds/nomatter.au