From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-05-14 15:52:22
-----BEGIN PGP SIGNED MESSAGE-----
On Wednesday 14 May 2008 15:31 pm, James Sutherland wrote:
> I have been testing thread performance on Linux and Mac. My Linux
> system has two dual-core processors and my Mac has one dual-core
> processor. Both are intel chips.
> For the code snippet given below, the execution time should ideally
> decrease as the number of threads increases. However, the opposite
> trend is observed. For example, using -O3 flags on my Linux desktop
> produces the following timings:
> 1 Thread: 0.66 sec
> 2 Threads: 0.9 sec
> 3 Threads: 1.2 sec
> 4 Threads: 1.4 sec
> I do not have a lot of experience with threads, and was wondering if
> this result surprises anyone?
If you print a debug message next to your
call, you'll see that you are creating more threads than you think you are.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk