Home » U++ Library support » U++ MT-multithreading and servers » multi-threading slower than single thread
Re: multi-threading slower than single thread [message #24829 is a reply to message #24788] |
Mon, 01 February 2010 07:29 |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
Quote: |
nixnixnix wrote on Fri, 29 January 2010 16:23
Hi,
I have a very strange thing happening. Just over 1 year ago I wrote some multi-threading code that scaled the performance of my calculation linearly with number of virtual cores. However, now that same code performs worse than a single thread.
Using my SVN I have stepped back in time one year and recompiled that code and it performs as I remember it.
My code now is many many times slower and the single threaded version performs better than the multithreaded version.
Generally, this is a sign that either synchronization costs or thread management costs are higher than gains of using multiple cores....
|
Hi Mirek,
I understand that there can be a significant overhead but my issue is that there was not one before and there is one now.
When I refer to SVN I am refering to my SVN. I stepped back through my SVN to grab a version that did not have this issue but is also not significantly different in terms of what I am trying to do.
Didier,
Thanks for your reply. What you say about the single vs multiple threads makes sense to me. However, because the calculations are grid calculations operating on structures allocated from heap memory, I have not used any mutex's, locks etc. although i agree there appears to be an issue like that. Mirek and Tomas now have my code so hopefully they will see something I don't.
Thanks again,
Nick
|
|
|
Goto Forum:
Current Time: Wed Jun 05 07:14:32 CEST 2024
Total time taken to generate the page: 0.02957 seconds
|