Re: multithreaded dll - what is going on in std::_Lockit?
- From: "Tom Widmer [VC++ MVP]" <tom_usenet@xxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 16:54:12 +0000
alan.lemon@xxxxxxxxx wrote:
I am working in VS2005 and I have created a multithreaded dll. For
this
particular project I need my code to be as fast as possible so I have
been using a profiler to see where any bottle necks exist in my
project. I am using Compuware's community edition profiler and
interestingly a lot of the time that my project spends is in :
std::_Lockit::_Lockit(int)
std::_Lockit::~_Lockit()
RtlEnterCriticalSection
RtlLeaveCriticalSection
I have done some searching around, but I don't understand what these
objects/functions do and if I can do anything about it. Any help would
be greatly appreciated.
As others have said, these relate to locking occuring in the standard library functions. There are several ways you can reduce the level of locking caused by standard library calls:
1. Make sure _HAS_ITERATOR_DEBUGGING is defined to 0. Iterator debugging involves a huge amount of locking an unlocking of a single global debug mutex. You are testing a release build, right?
2. Reduce the amount of dynamic memory alloction you do.
3. Use a more performant multithreaded memory allocator, such as hoard or google's allocator (http://goog-perftools.sourceforge.net/doc/tcmalloc.html).
Tom
.
- References:
- multithreaded dll - what is going on in std::_Lockit?
- From: alan . lemon
- multithreaded dll - what is going on in std::_Lockit?
- Prev by Date: Re: multithreaded dll - what is going on in std::_Lockit?
- Next by Date: Re: multithreaded dll - what is going on in std::_Lockit?
- Previous by thread: Re: multithreaded dll - what is going on in std::_Lockit?
- Next by thread: Subclassing woes
- Index(es):