On some machines, my .Net application is idling at ~10% CPU usage. My first inclination is that one of my background worker threads is executing some instructions that I’m not aware of, but I don’t know how to isolate CPU usage by thread (Task Manager simply tells me that my process uses x number of threads [usually around 30], not which threads are hogging CPU).
I know that programmatically I can iterate through the threads as mentioned in this post but I don’t know if that will give me the information I need. Is there a profiler (commercial or otherwise) that will allow me analyze CPU usage per thread?
I would recommend JetTrace dotTrace Performance. It will tell you where your code is spending most of its time, as well as the thread. (It is commercial but comes with a free 10 day trial.)