C # multithreading because the code has been optimized or the local framework is located on the call stack, the expression value cannot be calculated,

Source: Internet
Author: User

C # multithreading because the code has been optimized or the local framework is located on the call stack, the expression value cannot be calculated,

Find an explanation on the Internet:

A stack is used to store variables and methods. It is "placed above the call stack". We can understand that there are no variables or methods in the stack to call. In fact, the program has ended, the stack is empty (the pointer is on the external -- of the original stack ).
Put it in my actual scenario: I opened an asynchronous method to process an event, and the main thread did not wait for this Asynchronous Method to end directly. In fact, the main thread is closed, asynchronous mode is still running. The result is that the memory is released. If the asynchronous mode cannot find the variable, an error is returned.

Triggering scenario: when multiple threads run a large amount of data or complicated computing logic, the execution time exceeds 20 minutes, and the thread is automatically reclaimed by IIS.

Solution: IIS-> application pool-> Find the application pool of the application, right-click, advanced settings-> change idle timeout (minutes) to 1740 (20 minutes by default)

 

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.