Critical segment code in μC/OS-ⅲ

Source: Internet
Author: User

The critical section code (critical sections), also known as the critical section (critical region), refers to the code segments that must be fully and continuously run and cannot be interrupted. A large number of critical code segments exist in the μC/OS-ⅲ system. Two methods are used to protect the critical segment code: Disable the interrupt and lock the scheduler. The code protection functions of the two critical segments are implemented by macro definition.

For the critical segment code accessed by both the interrupt handler and the task, you must use the managed interrupt method for protection. For the critical segment code accessed only by the task, you can also use locks to lock the Scheduler for protection.

At the same time, the μC/OS-ⅲ system also has the function of measuring the shutdown interruption time and the scheduler lock time. This function can be used to measure the closing and locking times of a single time or the total closing locks.

Critical segment code in μC/OS-ⅲ

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.