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?
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?