473,791 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

STL map and Posix Threads

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
Jul 22 '05 #1
6 2484
cs********@yaho o.com (Chaman Singh) wrote in
news:de******** *************** ***@posting.goo gle.com:
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.
Jul 22 '05 #2
cs********@yaho o.com (Chaman Singh) wrote in
news:de******** *************** ***@posting.goo gle.com:
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.
Jul 22 '05 #3
On 8 Apr 2004 08:53:12 -0700, cs********@yaho o.com (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
Jul 22 '05 #4
On 8 Apr 2004 08:53:12 -0700, cs********@yaho o.com (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
Jul 22 '05 #5

"Chaman Singh" <cs********@yah oo.com> wrote in message
news:de******** *************** ***@posting.goo gle.com...
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.
Jul 22 '05 #6

"Chaman Singh" <cs********@yah oo.com> wrote in message
news:de******** *************** ***@posting.goo gle.com...
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.
Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2570
by: Dima | last post by:
This is my simple code #!/usr/local/bin/perl use threads; use threads::shared; use POSIX::RT::Semaphore; $sem = POSIX::RT::Semaphore->init(0, 0); my $pid = fork;
6
2229
by: Evan David Light | last post by:
After agonizing over this problem for a few days, I've decided to seek help. No, not the variety that involes a jacket that zips up the back but this august body of intrepid individuals. I've discovered the following: - My compile line should resemble: CC -D_PTHREADS -D_POSIX_C_SOURCE=199506L -LANG:std -n32 -mips3 -c <src> -o <obj> - My link line should resemble: CC -LANG:std -n32 -mips3 <objs> -o <executable> -lpthread
6
455
by: Chaman Singh | last post by:
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
6
2645
by: Christian Buckl | last post by:
Hi, I try to implement my own thread class based on POSIX threads. I want my class to manage everything (creation of threads, exception handling...). This includes also some functions that need to be called within the threads context (like setting the cancelability state and type). That´s why I am using a function that initializes the thread and then calls the original thread function. The problem is, that I can't manage to implement the...
2
3599
by: raxitsheth | last post by:
Hello All... I am using Posix Thread. class Parent { public: virtual void* func(void *)=0;
11
3012
by: FiLH | last post by:
Hello, I would like to know if posix semaphores are inter processes or just semaphores for threads inside the same process. I have not seen it defined in the posix specification I have found, but I have maybe missed something. Thanks in advance.
2
24283
by: dariophoenix | last post by:
Hi, I am trying to encapsulate Linux sockets and POSIX threads in C++ classes (I work in Knoppix, using KDevelop). Since sockets and threads are new to me, I searched for example code and found the following: #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <netdb.h>
23
5717
by: Boltar | last post by:
Hi I'm writing a threading class using posix threads on unix with each thread being run by an object instance. One thing I'm not sure about is , if I do the following: myclass::~myclass() { : : do stuff
8
4405
by: JackC | last post by:
Hi, I am trying to get posix threads working from within an object, heres some code: int NConnection::TheadControl() { int thread_id; pthread_t new_connection; pthread_create(&new_connection, NULL, PriC, (void *)thread_id);
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.