How does Concurrency work in WCF?

前端 未结 5 1096
天涯浪人
天涯浪人 2021-01-31 21:57

I am a novice in WCF and SOA. I am just starting out on these, I have a theoretical doubt:

Client A has called a service and the logic is currently executing on the se

5条回答
  •  盖世英雄少女心
    2021-01-31 22:08

    That depends on the value of the ConcurrencyMode property of the ServiceBehavior attribute that is applied to the service implementation. If the ConcurrencyMode is Single, the call from Client B will wait for the call from Client A to complete; if the ConcurrencyMode is Multiple, both will be executed at the same time but on separate threads.

    If not set, the ConcurrencyMode defaults to Single: http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.concurrencymode.aspx

    You may also find the InstanceContextMode property useful for understanding and controlling how multiple requests from multiple clients are handled: http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.instancecontextmode.aspx

提交回复
热议问题