I am currently coding an application that uses Pthreads. My boss just bought me a MacPro to make use of the 4 cores for my nice, new multithreaded application.
So, I can get everything to compile and link and run just fine. However, the multithreaded application actually runs SLOWER than the application without threads!
I figured I just had a bad implementation. But, I ran my code on another machine with 4 processors (4 Xeon 700Mhz Processors running Mandrake Linux) and low and behold, the multithreaded code is significantly faster.
I decided to shark the MT app on my MacPro and it turns out that almost 60% of the time is spent in an "unknown library". Shark suggests compiling with the -g option (i'm using gcc). However, this is all turned on. I really have no clue what is going on.
On the MacPro, I'm using the latest version of gcc (4.0.1) and the mandrake linux box is using 3.3.6.
Any help on this would be much appreciated.
Thanks!
Chris
So, I can get everything to compile and link and run just fine. However, the multithreaded application actually runs SLOWER than the application without threads!
I figured I just had a bad implementation. But, I ran my code on another machine with 4 processors (4 Xeon 700Mhz Processors running Mandrake Linux) and low and behold, the multithreaded code is significantly faster.
I decided to shark the MT app on my MacPro and it turns out that almost 60% of the time is spent in an "unknown library". Shark suggests compiling with the -g option (i'm using gcc). However, this is all turned on. I really have no clue what is going on.
On the MacPro, I'm using the latest version of gcc (4.0.1) and the mandrake linux box is using 3.3.6.
Any help on this would be much appreciated.
Thanks!
Chris