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
I would suggest filing a Developer Technical Support Incident. http://developer.apple.com/technicalsupport/ Or post to the developer lists at apple. http://lists.apple.com/mailman/listinfo
Any word? Did you ever get an answer from Apple? I am starting to convert a large multi-threaded Java app to C++ and pthreads (on the Mac), specifically to take advantage of multicore processing on the 8-core Mac Pro. Am I wasting my time or is there something about the Mac Pro / gcc4 on that needs to be figured out yet? Let us know, thanks!
This is basically a 2 year old thread. The chance of the OP responding is very small. Leopard I would assume would be better at handling multithreaded apps than Tiger was. Apple certainly worked on the scheduler in Leopard.
I know, I know... it was a shot in the dark but 200+ Java classes and dozens of threaded mathematical operations begged a little research before really getting started.
I would say your perfectly fine. Especially with Apple concentrating more on threading now. Snow Leopard is the next big thing for developers writing threaded applications.