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

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

Alvin Bruney

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.
 
J

John Saunders

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
}
 
A

Alvin Bruney

He will need a stronger lock than a critical section since the critical
section doesn't block threads outside the calling application.
 
J

John Saunders

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?
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top