CLR thread blocked?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

I have a .NET application that spawns a lot of threads that are then
executed according to availability of threads in the thread pool. In
each thread I query a database and then write results to disk to
separate files. Typically I have no problems, however, when I try to
run this application against say 500 databases on 100 servers, I notice
that one or two threads appear to freeze. Even when the main thread
that spawns all these other threads exits after timing out, the threads
are never returned to the threadpool ever. Looking at all my printed
messages, I do not understand why they are blocked - i.e., they are
explicitly waiting for a resource that I know of and should actually be
good to exit.

Could someone point me to a debugging or profiling tool that would
enable me to locate the source of this problem?

Thanks

.