湖边的白杨树

探索是一种乐趣

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

问题:WCF 有个Server端,还有个Client端,他们之间是如何进行并发,多线程通信的呢?多个Client端同时访问Server,如何保证Server端的操作线程安全呢?

 

在理解WCF Concurency之前,首先需要理解 WCF instance management

 这里有篇很好的文章可以参考:

https://www.codeproject.com/Articles/86007/3-ways-to-do-WCF-instance-management-Per-call-Per

Following are different ways by which you can create WCF instances:

  • Create a new WCF service instance on every WCF client method call.
  • Only one WCF service instance should be created for every WCF client session.
  • Only one global WCF service instance should be created for all WCF clients.

To meet the above scenarios, WCF has provided three ways by which you can control WCF service instances:

  • Per call
  • Per session
  • Single instance

 

 https://www.codeproject.com/articles/89858/%2fArticles%2f89858%2fWCF-Concurrency-Single-Multiple-and-Reentrant-and

 

posted on 2018-12-01 17:27  fdyang  阅读(1056)  评论(0编辑  收藏  举报