“Real time system is defines as a data processing system in which each task has a deadline to complete. RTOS adheres to this deadline as missing a deadline can cause effects ranging from undesired to catastrophic. A real-time system has well-defined, fixed time constraints.”
Lets take a look at an example
Suppose a person is driving a car on a highway. Unfortunately the car is in an accident.Now assume the OS is performing a calculation for the engine.
Real Time Operating System
- A scheduler is informed it is time to check the airbag signal and the calculation is saved and the Airbag collision signal is checked.
- A signal is seen and the airbag deployed at the right time and saved the life of the driver.
Non-Real Time Operating System
- The scheduler is informed it is time to check the airbag but the os is performing calculations and does not break.
- Calculations are finished 20ms later and the airbag is deployed late.
The time taken by the system to respond to an input and display of required updated information is termed as response time. So in this method response time is very less as compared to the online processing. Real time processing is always on-line whereas on-line system need not be real-time.
- Online processing: Processing performed under the direct control of the CPU whilst the remains in communication user with the computer.
- Offline processing: Processing which is done away from CPU.
Real-time operating system has well-defined, fixed time constraints other wise system will fail. For example Scientific experiments, medical imaging systems, industrial control systems, weapon systems, robots, and home-appliance controllers, Air traffic control system etc.
RTOS CAN BE CLASSIFIED INTO THREE TYPES:
- Hard RTOS: These types of RTOS strictly adhere to the deadline associated with the tasks. Missing on a deadline can have catastrophic affects. The air-bag example we discussed in the beginning of this article is example of a hard RTOS as missing a deadline there could cause a life.
- Firm RTOS: These types of RTOS are also required to adhere to the deadlines because missing a deadline may not cause a catastrophic affect but could cause undesired affects, like a huge reduction in quality of a product which is highly undesired.
- Soft RTOS: In these type of RTOS, missing a deadline is acceptable. For example On-line Databases.
Features of an RTOS:
- Context switching latency should be short: This means that the time taken while saving the context of current task and then switching over to another task should be short.
- The time taken between executing the last instruction of an interrupted task and executing the first instruction of interrupt handler should be predictable and short. This is interrupt latency.
- Similarly the time taken between executing the last instruction of the interrupt handler and executing the next task should also be short and predictable. This is interrupting dispatch latency.
- Reliable and time bound inter process mechanisms should be in place for processes to communicate with each other in a timely manner.
- A RTOS should have support for multitasking and task preemption. Preemption means switching the current executing task to a high priority task ready and waiting.
Some of the most widely used RTOS are: