Concurrency is the control of the number of threads active in an InstanceContext at any one time.
Single: – A single request has access to the WCF service object at a given moment of time. So only one request will be processed at any given moment of time. The other requests have to wait until the request processed by the WCF service is not completed.
Multiple: – In this scenario multiple requests can be handled by the WCF service object at any given moment of time. In other words request are processed at the same time by spawning multiple threads on the WCF server object.
So you have great a throughput here but you need to ensure concurrency issues related to WCF server objects.
Reentrant: – A single request thread has access to the WCF service object, but the thread can exit the WCF service to call another WCF service or can also call WCF client through callback and reenter without deadlock.
For example :
public interface IService1
void call(string name);
public class Service : IService
public void call(string name)
Console.WriteLine(“client name : ” + name + ” instance : ” +count.ToString() + ” Tread : ” +Thread.CurrentThread.ManagedThreadId.ToString()+ ” Time : ” + DateTime.Now.ToString() );
In the client :
static void Main(string args)
ServiceReference1.Service1Client obj = new ConsoleClient.ServiceReference1.Service1Client();
for (int i = 0; i < 5; i++)