how do I force IIS to single thread my web service??

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I have a web service running on IIS 5.0. We know the web
service is not threadsafe, and want to force aspnet_wp.exe
to only run one instance of our web service. What
settings do we use to do this.

I have tried modifying the machine.config file and setting
maxWorkerThreads=1. However, then I can't even get
aspnet_wp.exe to load. Can anyone help me out here?
 
What is the problem you are having? Setting a webservice to be single use
works contrary to the design of the service. There may be an alternate route
if your explain your threading problem.
 
Jason said:
I have a web service running on IIS 5.0. We know the web
service is not threadsafe, and want to force aspnet_wp.exe
to only run one instance of our web service. What
settings do we use to do this.

I have tried modifying the machine.config file and setting
maxWorkerThreads=1. However, then I can't even get
aspnet_wp.exe to load. Can anyone help me out here?

Try, at the start of every method in your web service, to do the following:

lock (typeof(MyWebService))
{
// non-thread-safe-code
}
 
He will need a stronger lock than a critical section since the critical
section doesn't block threads outside the calling application.
 
Alvin Bruney said:
He will need a stronger lock than a critical section since the critical
section doesn't block threads outside the calling application.

He said he wanted IIS to single-thread. What other threads outside the
application will be running the same instance of his web service?
 
Back
Top