Avatar of esak2000
esak2000
 asked on

c# / .net debugging multithread program

I'm using ThreadPool.QueueUserWorkItem in c# to multithread through many urls (using httpwebrequest). Sometimes the program will just just hang, and as my code is very long I don't know where it's hanging. What's the best way to debug this?

I've tried:

1.  adding timeouts to the  httpwebrequest request and readwrite request
2.  adding breaks in the for loops of the code while it's running but that doesn't seem to be the problem as it doesn't break. Is there a way to find out where the code is exactly while it's running?
.NET ProgrammingC#

Avatar of undefined
Last Comment
Sammy

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Michael Fowler

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Michael Fowler

For more options check out this listing
http://www.dotnetlogging.com/

Michael
SOLUTION
Sammy

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23