473,323 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Multithreaded application performance impact of global arrays

Hi all,

I've recently ported a rather large C application to run multithreaded.
A few functions have seriously deteriorated in performance, in
particular when accessing a rather large global array, that contains
information that is shared among threads.

Any idea, why the lines accessing this global array now take about 50x
longer in the multithreaded application?

I've googled around for general hints on the performance impact of
various common C language constructs regarding multithreaded
applications, i.e. some sort of "Do's and Don'ts" for multithreaded C
programs.

However, I could not find anything appropriate. Any hints are welcome!

best regards,
jan

Mar 17 '06 #1
3 2564
gr****@barnholt.net wrote:
Hi all,

I've recently ported a rather large C application to run multithreaded.
A few functions have seriously deteriorated in performance, in
particular when accessing a rather large global array, that contains
information that is shared among threads.

Any idea, why the lines accessing this global array now take about 50x
longer in the multithreaded application?


Threaded programming really isn't on topic here, try a group that
focuses on multi-threaded programming or your specific implementation.

<OT> When you did your conversion I assume you used some type of
locking mechanism to protect the global data. I would start by
profiling the functions in question to determine how much time they
spend waiting for the lock. </OT>

Robert Gamble

Mar 17 '06 #2
gr****@barnholt.net wrote:
Hi all,

I've recently ported a rather large C application to run multithreaded.
A few functions have seriously deteriorated in performance, in
particular when accessing a rather large global array, that contains
information that is shared among threads.

Any idea, why the lines accessing this global array now take about 50x
longer in the multithreaded application?

I've googled around for general hints on the performance impact of
various common C language constructs regarding multithreaded
applications, i.e. some sort of "Do's and Don'ts" for multithreaded C
programs.

However, I could not find anything appropriate. Any hints are welcome!


If you're restricting your search to standard C forums, you won't find
the answers. First, determine what style of platform you are working
with, and what style of threading. Then look up subjects like false
sharing, NUMA data placement, etc. accordingly.
Mar 17 '06 #3
gr****@barnholt.net writes:
I've recently ported a rather large C application to run multithreaded.
A few functions have seriously deteriorated in performance, in
particular when accessing a rather large global array, that contains
information that is shared among threads.

Any idea, why the lines accessing this global array now take about 50x
longer in the multithreaded application?


No. Try comp.programming.threads.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Mar 17 '06 #4

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

Similar topics

1
by: mark4asp | last post by:
What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include that file on every page. This is the best way of...
4
by: Jason Heyes | last post by:
What can I do to circumvent the performance degradation associated with dynamic allocation and small objects? Thanks.
1
by: daniel.bron | last post by:
I'm maintaining a C++ application written by a developer who has now left. The app is a multithreaded client/server app for financial data. My compiler is MS visual C++ 6.0. I'm a C++ neophyte....
8
by: Sebastian Werner | last post by:
Howdy, I currently develop the javascript toolkit qooxdoo (http://qooxdoo.sourceforge.net), some of you heard it already. We have discovered a slowdown on Internet Explorers performance when...
18
by: zebi | last post by:
hello, What's your opinion : The best type of temporary tablespace (DB2V7.2 SP 7 in AIX 4.3 / multiprocessor ) is DMS ou SMS ? Thanks ZEB
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
22
by: roadrunner | last post by:
Hi, Our website has recently been experiencing some problems under load. We have pinpointed a particular function which slows dramatically when we have these problems. Normally it should execute...
14
by: Sugandh Jain | last post by:
Hi, The warning from Microsoft.Performance Code Analysis check that, its not required to initialize numeric variables to zero, boolean to false and object to null is a good one because CLR does...
11
by: Sylvia A. | last post by:
How can I define global classes in web application ? Classes can be set to session variables ? Thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.