WCF REST Service: InstanceContextMode.PerCall 不管用,无法实现并发

Since the service is controlled by a GUI, the "UseSynchronizationContext" attribute was needed to solve the problem:

[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall,ConcurrencyMode=ConcurrencyMode.Multiple,UseSynchronizationContext=false)]


现在开发很多WCf程序已经不托管在IIS下,而是自托管了,所以在客户访问服务时,如果不进行如上设置 ,无法实现真正多的多线程,造成访问排队。

 
posted @ 2013-04-25 15:22  巴别塔  阅读(351)  评论(0编辑  收藏  举报