Does your native code deals with critical sections or other synchronization primitives?
If yes, and if you would like to get a clear picture of all contentions in your application, you might want to check out the new profiling mode of VS2010 Profiler – Resource Contention concurrency profiling. It collects and presents information about all contentions, when synchronization resources cause your threads to be blocked in an attempt to acquire the resource. Being contended, a thread doesn’t run. It waits. It wastes the time. It decreases the performance you wanted to gain from your super powerful multi-core machine, when you designed your application as a multithreaded in the first place.
For detailed explanation about how to collect contentions data, and what are the best ways to investigate it, follow the links.
- Resource Contention Concurrency Profiling in Visual Studio 2010 – June 2010 MSDN article
- Resource Contention Concurrency Profiling in Visual Studio 2010 – Performance Investigation Flows – a follow up blog to the MSDN article.
Resolve synchronization issues, if your code has any, and boost the performance of your application!