Resolves all single-threaded apartment (STA) threads in C # should use pump-wait primitives (such as cowaitformultiplehandles) and send messages periodically during long-running operations. Reproduced

Source: Internet
Author: User

Recently done a later program, started the transaction after a period of operation of the business, when running for a period of time, this exception occurs
The CLR cannot convert from COM context 0x1b1c38 to COM context 0x1b1da8, which has lasted for 60 seconds. The thread that owns the target context/unit is most likely to perform a non-pump wait or handle a very long operation without sending a Windows message. This situation often affects performance and may even cause the application to not respond or use memory to accumulate over time. To avoid this problem, all single-threaded apartment (STA) threads should use pump-wait primitives (such as cowaitformultiplehandles) and send messages periodically during long-running operations.
----

Temporary and feasible solutions:
Remove the ContextSwitchDeadlock front hook in debug assistants, Managed, Debug, Exceptions.
In debug (menu)--Exception-->-> Managed Debug Assistants Remove ContextSwitchDeadlock a front hook.

Reference article:

Http://www.csden.com/posts-id-1007.aspx

http://bbs.csdn.net/topics/370162431

Resolves all single-threaded apartment (STA) threads in C # should use pump-wait primitives (such as cowaitformultiplehandles) and send messages periodically during long-running operations. Reproduced

Related Article

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.