FreeRTOS Lecture 3 – RTOS vs GPOS: Task Scheduling

 

RTOS vs GPOS: Task Scheduling 

 

 

Difference between the Real-Time Operating System(RTOS) and the General-Purpose Operating System(GPOS) in terms of task scheduling.

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 cases, 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 lower priority tasks than by serving a single high priority one. So, if 5 or 6 low priority tasks are waiting to run, then it will delay the high priority task, and it will allow the lower priority task to run in order to maintain the higher throughput.

In a GPOS, the scheduler typically uses a fairness policy to dispatch threads and processes onto the CPU. Such a policy enables the high overall throughput required by desktop and server applications but offers no guarantees that high priority, time-critical threads or processes will execute in preference to lower priority threads. On the other hand, in RTOS, threads execute in the order of their priority. If a high-priority thread becomes ready to run, it will take over the CPU from any lower-priority thread that may be executing. Here a high-priority thread gets executed over the low-priority ones. All low priority thread execution will get paused. A high priority thread execution will get override only if a request comes from an even high priority thread.

 

Does that mean RTOS is very poor in delivering throughput?

The fact is a Real-Time Operating System may yield less throughput than a General-Purpose OS because it always favors the high-priority task to execute first, but that doesn’t mean it has very poor throughput because these two operating systems that is GPOS and Real-Time Operating Systems, are used entirely in different scenarios.

The GPOS is always loaded with heavy processes and more processes. But a Real-Time Operating System, most of the time, is loaded with a fewer number of tasks. A throughput is actually relative to the load of the system.

A quality RTOS will still deliver decent overall throughput but can sacrifice throughput to be deterministic or achieve time predictability. For the RTOS, achieving predictability or time deterministic nature is more important than throughput, but for the GPOS achieving higher throughput for user convenience is more important.

In the next article, let’s learn RTOS vs GPOS : Latency.

 

FastBit Embedded Brain Academy Courses 

click here: https://fastbitlab.com/course1

FastBitLab

The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.