Distinguishing preemptive kernel and kernel type inalienable

        Since the embedded system is only one CPU, so at a specific time only allows a plurality of tasks in the use of CPU. The tasks in the system to obtain the right to use the CPU way, real-time multitasking operating system kernel into preemptive and non-preemptive kernel core types. But in terms of two types of kernels, each task must have a unique priority right to represent it gets CPU.

        Inalienable core type, also known as cooperative multitasking kernel. In this kernel, a high-level task priority is always the first to get the right to use the CPU. To prevent a task always occupy the right to use the CPU, the kernel requires that each task must be able to give up the right to use the CPU.

        In preemptive kernel, CPU always running multiple tasks in the task of the highest priority, even if the CPU is running a low-level tasks, when there are high-priority task is ready, the priority of the task CPU will be deprived of the right to use a running task, so that they have gained the right to use the CPU.

        Because preemptive real-time kernel is better, so now most embedded real-time operating system is a preemptive kernel.

First, the implementation process can not be preemptive kernel:
(1) when the task A is running an interrupt, the interrupt service routine, the higher priority task B ready.
(2) Interrupt service is finished, return and continue the task A.
(3) until the end of the task A, task B did get run.

Inalienable type core schematics

    Second, the implementation process preemptive kernel:
(1) when the task A is running an interrupt, the interrupt service routine, the higher priority task B ready.
(2) Interrupt service is finished, return to the higher priority task B, get run.
(3) until the end of the task B, task A run was obtained.

Preemptive kernel schematics


 

Published 33 original articles · won praise 30 · views 20000 +

Guess you like

Origin blog.csdn.net/baidu_15547923/article/details/100043209