4

I have a windows service that starts a host for a WCF service. I have an interface defining the ServiceContract and OperationContracts. There is a class that implements this interface. The ServiceBehavior attribute is PerSession. As I understand, each session get its own class instance on the WCF service.

[ServiceBehavior(InstanceContextMode = ServiceModel.InstanceContextMode.PerSession)]
public class WCFServiceImplementation : WCFServiceInterface
{

}

Now some where in my WCFServiceImplementation I am calling Threading.Thread.Sleep(1000) (there are some race conditions). My question - can the service still be called by other clients while the thread is in sleep? I am not very familiar with threading, does each class instance run on its own separate thread with WCF services.

swiftgp
  • 997
  • 1
  • 9
  • 17

1 Answers1

2

Yes, the service can still be called by other clients because they will be on other sessions.

Mike Perrenoud
  • 66,820
  • 29
  • 157
  • 232