Priority control system and task scheduling in RTOS
Implementing priority control system and task scheduling in RTOS
Abstract: Real-time operating systems (RTOSs) are becoming increasingly seeming in all places, so controlling a wide variety of such popular and time critical devices and some effective testing techniques could improve the efficiency of these systems. In this paper we differentiate between normal OS and real-time OS. How real-time OS works comparing with our normal OS.
In real-time OS we have different type of task scheduling and priority based controlling system where as in normal OS we don’t have this type of controlling and scheduling. And in RTOs we have special feature as like we can assign specific time for each task.
Problem statement: Implement a framework for industrial control systems which help to avoid dead-lock occurrence and help us to assign specific time for each event and also handle the event based on priority.
Motivation: Sometime dead-lock occurs where more than one interrupt signal trying to occur at same time. To overcome this kind of problems there are some solutions like task scheduling, priority assigning etc.
In this real-time OS we are selecting priority based control system which mainly assigns the priority for a particular task. By implementing this logic we can avoid dead-lock occurrence.
Introduction:
Let us define the terms which will be using in this paper:
• Task scheduling - Let’s take the case of task scheduling first. In the case of a GPOS – task scheduling is not based on “priority” always! GPOS is programmed to handle scheduling in such a way that it manages to achieve high throughput.
Here throughput means – the total number of processes that complete their execution per unit time. In such a case, sometimes execution of a high priority process will get delayed in-order to serve 5 or 6 low priority tasks. High throughput is achieved by serving 5 low priority tasks than by serving a single high priority one. Where as in an RTOS – scheduling is always priority based. Most RTOS uses pre-emptive task scheduling method which is based on priority levels. Here a high priority process gets executed over the low priority ones. All “low priority process execution” will get paused. A high priority process execution will get override only if a request comes from an even high priority process.
• Priority based scheduling -
Typical RTOS based on fixed-priority preemptive scheduler, assign each process a priority, at any time, scheduler runs highest priority process ready to run, process runs to completion unless preempted
In priority scheduling the task is driven by CPU that depend upon priority in that task, each task is assigned a priority from 0 to (configMAX_PRIORITIES - 1 ), where configMAX_PRIORITIES is defined within FreeRTOSConfig.h and can be set on an application by application basis.
The FreeRTOS scheduler ensures that tasks in the Ready or Running state will always be given processor (CPU) time in preference to tasks of a lower priority that are also in the ready state. In other words, the task placed into the Running state is always be the highest priority task that is able to run.
Ready state tasks of equal priority share the available processing time using a time sliced round robin scheduling scheme.
Preemptive is base on the priority based scheduler. Preemptive means if there have the high priority task want to run the low priority task will be pushed to the stack and then high priority task takes place.
As concern with normal OS, most of them just have two priority, system and user. But in RTOS always have many task have different priority, the run time of every task can be defined because of the preemptive. Preemptive means the OS can interrupt a running task to possible run another task before resuming back to the previous task. Priority scheduling means each task has its own priority .These priority can be assigned at the beginning or can be dynamically re-assigned while all the task are running .Several priority based, and preemptive scheduling algorithms: rate monotonic scheduling (RMS) –the shorter period of the task, the higher its priority, Deadline monotonic scheduling (DMS)- the shorter deadline of a task, the higher its priority.
Comments