calling ThreadPool.SetMaxThread in ASP.NET

F

Fowad

I am using ThreadPool to generate multiple threads in my Web Service. Web
methods call ThreadPool.QueueUserWorkItem and then wait for the response
using Monitor.Wait.

All of this works, unless I call SetMaxThreads in the constructor. In this
case, the first call goes through but it hangs the process. Subsequent calls
get no response from the web service.

SetMinThreads seems to cause no problems though. Any idea
 
J

John Saunders [MVP]

Fowad said:
I am using ThreadPool to generate multiple threads in my Web Service. Web
methods call ThreadPool.QueueUserWorkItem and then wait for the response
using Monitor.Wait.

All of this works, unless I call SetMaxThreads in the constructor. In this
case, the first call goes through but it hangs the process. Subsequent
calls
get no response from the web service.

SetMinThreads seems to cause no problems though. Any idea

I don't know the exact answer, but in general, a web service shouldn't need
to screw around with thread pool settings.

Also, were you aware that your web service requests arrive on a thread pool
thread, and while your service is waiting for the worker thread to complete,
you service is holding on to the thread pool thread? This prevents it from
being used by other requests.
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top