WCF Example (12)

Source: Internet
Author: User

Introduced

WCF (Windows communication Foundation)-Concurrency (Concurrent):

1, ConcurrencyMode.Single: single-threaded concurrent mode. system automatically lock, no concurrency problems

· Instancecontextmode.percall: Each thread will be assigned a new instance

· Instancecontextmode.persession: Each session is assigned a new instance, and there will be only one thread-action instance in each of the sessions

· Instancecontextmode.single: Unique instance, only one thread action instance in concurrent invocation

2. Concurrencymode.reentrant: A single threaded concurrency mode that can be reentrant. This mode takes effect when there is a reentrant (callback) operation, and the thread returned from the callback enters the queue's tail line

· Instancecontextmode.percall: Each thread is assigned a new instance, and when there is a callback, a deadlock is generated if the single concurrency mode is used (1, the calling service, 2, the callback client, 3, the service end, 1 is locked, Can not execute at 3, so deadlock), this time should use reentrant concurrency mode

· Instancecontextmode.persession: Each session is assigned a new instance, and there will be only one thread action instance in each sessions, which can be reentrant

· Instancecontextmode.single: A unique instance in which only one thread action instance can be called concurrently, and the global reentrant

3, Concurrencymode.multiple: Multithreading concurrency mode. The system does not automatically lock, there are concurrent problems

· Instancecontextmode.percall: Each thread will be assigned a new instance with no concurrency problems

· Instancecontextmode.persession: Each session is assigned a new instance, and there are concurrent problems with multiple instances of multithreaded operations

· Instancecontextmode.single: Unique instance, allows multithreading concurrent operation instance, has concurrency problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.