Abstract: The Real-Time Multitasking system mechanism and performance are described comprehensively, and a method to realize this Real-Time Multitasking mechanism is proposed: the time slice rotation scheduling method. This scheduling algorithm is implemented in microcontroller and an example of its application in the train gate friction coefficient test system is provided.
Keywords:Real-Time Multitasking; time slice; rotation scheduling; Microcontroller
In the field of Microcomputer Control, most systems are real-time control systems. Real-time means to respond to and process random external events in a timely manner. In order to better complete real-time data collection, processing, storage and various real-time control operations, real-time and multi-task concurrency must be taken into account at the same time. Ensure that the system responds to and processes external events quickly enough, and execute multiple tasks concurrently at a macro level. The Real-Time Multitasking system relies on appropriate task scheduling methods to determine which task in the system can obtain CPU and other system resources, and which task is temporarily out of the running state, so as to achieve the purpose of real-time processing of multiple tasks. The time slice rotation algorithm is a common algorithm for multi-task scheduling. In this algorithm, if a time slice is assigned to a task, the task obtains and runs the CPU in the time slice, and then allocates the CPU to another task when the next time slice arrives. In this way, concurrent tasks run in parallel at the micro level.