Threads eating 100% CPU

  • Thread starter Thread starter herbert
  • Start date Start date
H

herbert

I wrote an asynchronous TCP/IP server using the NET asynch pattern.
After exchanging a few messages with a client, suddenly this process eats
100% CPU load.
The VS. process starts with 16 threads and when message exchange starts
shows 18 threads in the task manager which is correct as the client holds two
sessions with the server.

How can I find out WHICH thread is the reason for the CPU load?

And why ? Cause after all this are threadpool threads due to the asynch
pattern. I instrumented my code with console.writeline and cannot see any
unusual activity in my code.

How can I get VS.2008 to name its threads?

The behaviour is the same in DEBUG and RELEASE mode.
VB.NET, Win XP Pro, VS.2008 all on highest SP.

As this is a high perf server, there are several asynch reads pending.

thank you very much, herbert
 
herbert said:
I wrote an asynchronous TCP/IP server using the NET asynch pattern.
After exchanging a few messages with a client, suddenly this process eats
100% CPU load.
The VS. process starts with 16 threads and when message exchange starts
shows 18 threads in the task manager which is correct as the client holds
two
sessions with the server.

How can I find out WHICH thread is the reason for the CPU load?

And why ? Cause after all this are threadpool threads due to the asynch
pattern. I instrumented my code with console.writeline and cannot see any
unusual activity in my code.

How can I get VS.2008 to name its threads?

The behaviour is the same in DEBUG and RELEASE mode.
VB.NET, Win XP Pro, VS.2008 all on highest SP.

As this is a high perf server, there are several asynch reads pending.

thank you very much, herbert

First thing that came into my mind is to start ProcessExplorer
(www.sysinternals.com -> MSFT), double-click the process and open the
"threads" folder. Double-click the busy thread to get a picture of what's
going on.


Armin
 
Thank you, excellent tool.

( I had two threads creating the same file at the same time, this mad two
mscor methods enter an endless loop)
 
Back
Top