CPU usage too low! (with debugger attached)

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top