Threads eating 100% CPU

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
 
A

Armin Zingler

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
 
H

herbert

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)
 

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