2.5.2 Special operating system - real-time operating system: real-time operating system, real-time performance indicators, multi-task scheduling algorithm

2.5.2 Special operating system - real-time operating system: real-time operating system, real-time performance indicators, multi-task scheduling algorithm

real-time operating system

A real-time operating system (Real Time Operating System, referred to as RTOS) means that when external events or data are generated, they can accept and process them at a fast enough speed, and the processing results can control the production process or An operating system that responds quickly to the processing system, schedules all available resources to complete real-time tasks, and controls the coordinated operation of all real-time tasks. Providing timely response and high reliability are its main features.

real-time performance indicators

  • Statistical task switching time
  • Indexes related to interrupt processing, from interrupt to start response, including interrupt delay time and interrupt response time will affect the real-time performance of the system
  • System response time (mainly reflected in the time to respond to user input or requests)
  • Semaphore shuffling time (refers to the time delay from when a task releases a semaphore to when another task waiting for the semaphore is activated)

Multi-task scheduling algorithm

There are many scheduling algorithms for real-time systems.

Priority scheduling algorithm: Assign a relatively fixed priority order, and then the scheduler performs priority scheduling of high-priority tasks in chronological order according to the priority order. (non-preemptive)

Preemptive priority scheduling algorithm: Based on the priority scheduling algorithm, high priority tasks are allowed to preempt low priority tasks to run.

Time rotation scheduling algorithm: the scheduler will schedule each character to run a small time slice in turn, and then schedule another task. After each task runs for a time slice, no matter whether it ends or not, the CPu will be released to let the next task run. (The pure time round-robin scheduling algorithm cannot meet the requirements of real-time systems, and is replaced by priority-based preemptive time round-robin scheduling)

The latest deadline scheduling algorithm: the scheduler schedules each task at the time closest to the end of its deadline

Earliest Deadline Scheduling Algorithm: The scheduler selects the task with the earliest deadline head-end time for scheduling according to the deadline time of each task

In RTOS, most RTOS scheduling algorithms are preemptive.

おすすめ

転載: blog.csdn.net/qq_41929714/article/details/129570696