On Mon, 2007-10-15 at 03:26 +1000, skaller wrote: > I will be looking at parallel programming support based on openMP. > Gcc/g++ 4.2 now implements much of openMP.
Preliminary tests with Ubuntu-gutsy, gcc 4.2.1 with -fopenmp and some tutorial examples show openmp SLOWS down code going from 1 to 2 threads on a dual core AMD64x2 by a massive amount. The examples do appear to work correctly. The CPU monitor definitely pushes both cores up to 100%. It isn't clear why this should be. Pushing the number of threads from 2 to 8 has no significant impact, so pre-emptions aren't an issue. Some of the tests run the threads without synchronisation for a considerable time, so that isn't the issue either. Note that amd64 has a separate cache for each processor, so loss of cache isn't the issue (and 8 threads run in about the same time as 2). The only thing I can think of is that gomp is using Posix TLS for thread local storage. This would destroy performance and would be utterly the wrong idea : TLS is exclusively for broken legacy C programs, not new code. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language