STL map and Posix Threads

C

Chaman Singh

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
 
A

Andre Kostur

(e-mail address removed) (Chaman Singh) wrote in
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.
 
T

tom_usenet

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
 
N

Nick Hounsome

Chaman Singh said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top