10 Supplementary knowledge - Deprivable kernel and non-deprivable kernel
[Copy link]
Non-preemptive kernel Non-preemptive kernel requires each task to give up the ownership of the CPU. Non-preemptive scheduling is also called cooperative multitasking, where tasks cooperate with each other to share a CPU. Asynchronous events are still handled by interrupt services. Interrupt services can make a high-priority task go from a suspended state to a ready state. However, after the interrupt service, the control right will still return to the task that was originally interrupted, until the task actively gives up the right to use the CPU, and then the high-priority task can get the right to use the CPU. Non-preemptive kernel allows each task to run until the task voluntarily gives up the control of the CPU. Interrupts can be sent to running tasks. After the interrupt service is completed, the CPU control is returned to the interrupted task. Task-level response time is much better than the previous and next systems, but it is still unknown. Commercial software almost has no non-preemptive kernel. The working process of the non-preemptive kernel is shown in the figure below: The preemptive kernel [p=22, null, When system response time is important, use a preemptive kernel. Therefore, μC/OS-Ⅱ and most commercially available real-time kernels are preemptive kernels. The highest priority task always gets control of the CPU once it is ready. When a running task puts a higher priority task into the ready state, the current task's CPU usage rights are preempted, or suspended, and the higher priority task immediately gets control of the CPU. If an interrupt service routine puts a high priority task into the ready state, when the interrupt is completed, the interrupted task is suspended and the higher priority task starts running. With a preemptive kernel, it is known when the highest priority task can execute and get control of the CPU. Using a preemptive kernel optimizes task-level response time. The working process of the preemptive kernel is as follows: https://bbs.eeworld.com.cn/data/attachment//forum/month_1103/20110306_54b8f1452162f075ea4794OMDbwqRvXZ.jpg[/img]
|