1.

Explain Concurrency management.

Answer»

In WCF, concurrency issues can occur when multiple threads access the same resource simultaneously. One request can be handled at a time by the WCF service. With WCF concurrency management, you can control multiple threads within an InstanceContext at any given time USING System.ServiceModel.ServiceBehaviorAttribute. It also helps you to configure the number of service instances that can serve multiple concurrent requests. 
WCF 4.0 supports three types of concurrency:

  • Single Concurrency Mode: In this scenario, the WCF service object is accessible to one request at a time. As a result, only one request can be processed at any given time.
  • Multiple Concurrency Mode:  In this scenario, the WCF service object can HANDLE multiple requests at any given time in this scenario. In simple words, multiple threads are spawned on the WCF server object to processing requests at the same time.
  • Reentrant Concurrency Mode: As described here, the WCF service object is accessible to only one request thread, but this thread MAY exit the WCF service to invoke another WCF service or may utilize a callback to invoke a WCF CLIENT and then reenter without deadlock.


Discussion

No Comment Found