STL map and Posix Threads

Discussion in 'C++' started by Chaman Singh, Apr 8, 2004.

  1. Chaman Singh

    Chaman Singh Guest

    Hello,

    I wanted to use Threads on Sun 4 node SMP. In my program I use STL map and I
    noticed that I don't get any speedup from using threads and I suspect that it
    has something to do STL map. Can anybody throw some light on this issue ?

    csv
    Chaman Singh, Apr 8, 2004
    #1
    1. Advertising

  2. Chaman Singh

    Andre Kostur Guest

    (Chaman Singh) wrote in
    news::

    > Hello,
    >
    > I wanted to use Threads on Sun 4 node SMP. In my program I use STL map
    > and I noticed that I don't get any speedup from using threads and I
    > suspect that it has something to do STL map. Can anybody throw some
    > light on this issue ?


    Not really. Threading is off-topic in comp.lang.c++. You need to talk to
    your compiler vendor (and/or the vendor of your STL implementation.. they
    may not be the same people) as to how they handle threading within their
    STL implementation.
    Andre Kostur, Apr 8, 2004
    #2
    1. Advertising

  3. Chaman Singh

    tom_usenet Guest

    On 8 Apr 2004 08:53:12 -0700, (Chaman Singh)
    wrote:

    >Hello,
    >
    >I wanted to use Threads on Sun 4 node SMP. In my program I use STL map and I
    >noticed that I don't get any speedup from using threads and I suspect that it
    >has something to do STL map. Can anybody throw some light on this issue ?


    Have you profiled the code to find out where the bottlenecks are? It
    might be something to do with map (it might be making many memory
    allocations, with a global, mutexed memory allocator). It might be
    something else.

    Tom
    --
    C++ FAQ: http://www.parashift.com/c -faq-lite/
    C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
    tom_usenet, Apr 8, 2004
    #3
  4. "Chaman Singh" <> wrote in message
    news:...
    > Hello,
    >
    > I wanted to use Threads on Sun 4 node SMP. In my program I use STL map and

    I
    > noticed that I don't get any speedup from using threads and I suspect that

    it
    > has something to do STL map. Can anybody throw some light on this issue ?
    >
    > csv


    Get a good book on writing programs with POSIX threads.
    Threads cannot be efficiently bolted on to a prog in general.
    Without more info it is impossible to say whether the map is a problem.
    The map is unlikely to be thread safe anyway.
    Nick Hounsome, Apr 9, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Evan David Light
    Replies:
    6
    Views:
    457
    David Anderson
    Dec 1, 2003
  2. Heiko Neuhaus

    POSIX Threads causing memory leak

    Heiko Neuhaus, Dec 21, 2003, in forum: C++
    Replies:
    3
    Views:
    2,568
    Paul Pluzhnikov
    Dec 21, 2003
  3. Christian Buckl
    Replies:
    6
    Views:
    679
    Alf P. Steinbach
    Oct 8, 2004
  4. kl
    Replies:
    7
    Views:
    1,275
    James Kanze
    Jan 1, 2008
  5. Richard Cranium

    Posix Threads and select()

    Richard Cranium, Jan 2, 2008, in forum: C Programming
    Replies:
    2
    Views:
    756
    suresh shenoy
    Jan 2, 2008
Loading...

Share This Page