strange Pthread behaviour on MacPro

Discussion in 'Mac Programming' started by dickson, Nov 8, 2006.

  1. dickson macrumors newbie

    Joined:
    Nov 8, 2006
    #1
    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
     
  2. Fukui macrumors 68000

    Fukui

    Joined:
    Jul 19, 2002
    #2
    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
     
  3. amazingworld macrumors newbie

    Joined:
    Oct 25, 2008
    #3
    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!
     
  4. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    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.
     
  5. amazingworld macrumors newbie

    Joined:
    Oct 25, 2008
    #5
    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. :)
     
  6. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    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.
     

Share This Page