Boost logo

Boost :

From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-05-14 15:52:22


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

threads.create_thread();

call, you'll see that you are creating more threads than you think you are.

- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIK0L35vihyNWuA4URAvmEAKCR/MEdyxSpTEKCYBLXvnycHesNLACfVRyN
YI7DqOs00Q3v7bx04hvxpGU=
=bhMj
-----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