CPU usage too low! (with debugger attached)

  • Thread starter Thread starter Armin Zingler
  • Start date Start date
A

Armin Zingler

Hi,

actually it's a long story.... I'm making it short:

In a loop, I'm starting three threads (as many as CPU cores).
Whenever one of the thread finishes, I'm checking if there's
more work to do the whole job. If yes, I'm starting another
thread, so there are always three threads running.

Without a debugger attached, the whole job takes 2.5 seconds.
CPU usage is 100% as expected.

With the VS debugger attached (managed debugging only), execution
time is ~6.2 seconds. There are no breakpoints set, hence I
wonder why it takes that much longer. But my main concern is
why CPU usage is only at ~60%.

With the VS debugger attached (mixed mode debugging), it takes
~45 seconds! CPU usage is only 6 - 10%! Why that? There must
be waithandles causing this. What is it waiting for,
and why only with a debugger attached? My threads can run
completely independently, so it's not an application issue.
The IDE (devenv.exe) is also not busy during the job.

I know, not a pure VB.Net question. :-/ Anyone's ever seen this
behavior?
 
Back
Top