HttpWebRequest and ThreadPool running out of threads

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

Hi,
I have the problem of my ThreadPool running out of threads as a result of
using the HttpWebRequest class. I do use the class asynchronously and I do
call a ThreadPool.RegisterWaitForSingleObject to Abort the HttpWebRequest
object if no response in 10 seconds. Any ideas as to how I can solve this
problem would be greatly appreciated.
Regards,
Craig
 
I saw this a long time ago when the thread was doing other operations that
consumed threads, like file IO. Put something in (a static counter for
example) that keeps your spawned threads below 25, and subtract a thread for
any instance where IO might occur - like making a webrequest within a pool
thread and see if your problem still occurs.
 
Back
Top