Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
What is a Time-Sharing Operating System?
2.1.
Advantages 
2.2.
Disadvantages
3.
What is a Real-Time Operating System? 
3.1.
Advantages 
3.2.
Disadvantages
4.
Difference between Time-sharing OS and Real-time OS
5.
Frequently Asked Questions
5.1.
What is the difference between time-sharing and real-time sharing?
5.2.
Which is real-time example of time sharing OS?
5.3.
What are the types of real-time OS?
5.4.
What is called time-sharing operating system?
6.
Conclusion
Last Updated: Mar 27, 2024
Medium

Difference between Time-Sharing and Real-Time Operating System

Author Pakhi Garg
1 upvote
Operating System

Introduction

Time-Sharing operating systems and Real-Time operating systems are two types of operating systems that can be differentiated in various ways. The time-sharing operating system mainly performs simple tasks, whereas the real-time operating system performs specific tasks.

In this blog, we will discuss time-sharing and real-time operating systems and their differences.

Let’s begin with the time-sharing operating system.

What is a Time-Sharing Operating System?

A time-sharing operating system allows multiple users to simultaneously access the same computer system from different locations. That means if you and your friends want to work on the same system from your homes, then time-sharing systems can fulfil your wish. 

Time Sharing OS

In the above figure, 

  • User 2 is in the active state means the processor is currently executing this user’s program. Moreover, only one user can be in the active state at a time.
  • User 5 is in the ready state means the user’s process is ready to execute and is waiting for the processor. More than one user can be in the ready state at a time.
  • User 1, user 3, user 4, and user 6 are in the waiting state meaning these users’ processes are waiting for some I/O operation. More than one user can be in the waiting state at a time.

A time-sharing operating system uses the concept of multiprogramming and CPU scheduling. The operating system performs multiple tasks through multiprogramming by continuously switching the processor between them. 

For example, if there are three processes in the system, P1, P2, and P3, the operating system will make the processor execute each process for a short period of time until an I/O request. This short period of time during which the user has the CPU's attention is referred to as a time slicetime slot, or quantum. It is usually in the range of 10 to 100 milliseconds. In this way, each process gets the processor for some time, and this cycle is repeated until all the processes are completed. The order in which the process will get the CPU is decided through CPU scheduling.

One more vital point to note is that the switching of the processes by the processor is so fast that we can’t tell which process is currently executing. It feels like all processes are getting executed simultaneously.  

Some examples are UNIX, Multics, Linux, Windows 2000 server, Windows NT server, TOPS-10 (DEC), or TOPS-20 (DEC). 

Now, let’s discuss the advantages and disadvantages of the time-sharing operating system.

Advantages 

The advantages of the time-sharing operating system are-

  1. It provides a quick response.
  2. It reduces the CPU idle time.
  3. It avoids duplication of the software.
  4. It provides equal opportunity to each process.

Disadvantages

The disadvantages of the time-sharing operating system are-

  1. The user’s programs and data are not secure.
  2. It has the problem of data communication.
  3. It has the problem of reliability.

Now, let’s discuss the real-time operating system.

What is a Real-Time Operating System? 

A real-time operating system (RTOS) is used in those environments where we want the result of a task in a fixed time interval. It is mostly used in embedded systems where the results of the computations are used to influence a process while it is running. 

When an event occurs outside of the computer, it is communicated to the computer via a sensor that is used to monitor the event. The sensor generates a signal, which the operating system interprets as an interrupt. When an interrupt is received, the operating system invokes a specific process or set of processes to handle the interrupt. Unless a higher priority interrupt occurs during execution, this process is entirely uninterrupted. 

If the system does not provide the result in a fixed time interval, it is considered a system failure.

The below figure shows the position of RTOS in the computer-

Real time os

The RTOS is widely used in real-world applications like scientific work, robotics, airline traffic control system, medical system, industrial control system etc.

There are three types of real-time operating systems. These are-

Real-Time Operating System

Let’s discuss them one by one.

  1. Hard Real-Time Operating System- In hard real-time operating systems, the critical tasks must be executed within the deadline. If the deadline is not met, it may result in critical failures. Examples of hard RTOS are- airplane sensor and autopilot systems, spacecraft, and planetary rovers.
  2. Soft Real-Time Operating System- In soft real-time operating systems, if the deadline for the execution of a task is missed, then the consequences are not critical. Some delay is allowed in the execution. Some examples of soft RTOS are- audio and video delivery software for entertainment.
  3. Firm Real-Time Operating System- Following the deadline is essential in firm real-time operating systems. If the deadline is missed, it may not have critical consequences but undesired effects. Examples of firm RTOS are- financial forecast systems and robotic assembly lines.

Now, let’s discuss the advantages and disadvantages of the real-sharing operating system.

Advantages 

The advantages of the real-sharing operating system are-

  1. It provides more utilization of devices and systems.
  2. It takes less time to shift from one task to another.
  3. It focuses on only one application at a time.
  4. Since the program's size is small, RTOS can be used in embedded systems.
  5. These systems are error-free.
  6. These systems manage the memory efficiently. 
    You can also read about : Advantages of Operating System

Disadvantages

The disadvantages of the real-sharing operating system are-

  1. It allows very few processes to execute simultaneously.
  2. Sometimes, the system resources are not good and expensive. 
  3. The algorithms used are pretty complex.
  4. Specific device drivers and interrupt signals are needed.
  5. They perform minimal task switching.

Since we got an overview of the time-sharing and real-time operating systems, let’s discuss the difference between them.

Click on the following link to read further: Open Source Operating System

Difference between Time-sharing OS and Real-time OS

We will consider various features to understand the difference between the time-sharing operating system and the real-time operating system.

Features

Time-sharing operating system

Real-time operating system

Definition A time-sharing operating system allows multiple users to access the same computer system from different locations simultaneously.  A real-time operating system (RTOS) is used in those environments where we want the result of a task in a fixed time interval.
Aim It aims to provide a quick response. It aims to produce the result before the specified time interval.
Response The response is generated in less than a second. The response is generated within the fixed time interval.
Computer Resources The computer resources are shared between all the users working on that system. The computer resources are allotted to each process for a fixed amount of time.
Switching There is switching from one process to another. There is minimal switching from one process to another.
Modifying the program Any modification in a program is possible. No modification in a program is possible.
Number of applications running It can run several applications simultaneously. It can run only one application at a time.
System failure It doesn’t lead to system failure when a deadline is not accomplished.  It may lead to system failure if the task is not done within the specified time. 

You can also read about layered structure of operating system and Difference Between Bit and Byte, Demand Paging in OS

Frequently Asked Questions

What is the difference between time-sharing and real-time sharing?

Multiple users can interact with computer systems simultaneously using time-sharing operating systems, which switch the CPU between them. On the other hand, a real-time operating system is more likely to complete a single task at a time and deliver services on time.

Which is real-time example of time sharing OS?

A real-time example of a time-sharing operating system is a modern desktop or server OS like Linux or Windows. It allocates CPU time to multiple user processes simultaneously, ensuring fair and efficient resource sharing and multitasking.

What are the types of real-time OS?

Real-time operating systems (RTOS) can be categorized into two main types:

  1. Hard Real-Time OS: Guarantees tasks are executed within strict, deterministic time constraints.
  2. Soft Real-Time OS: Provides timely execution but allows flexibility in meeting deadlines, with some tolerance for delays.

What is called time-sharing operating system?

A time-sharing operating system, also known as a multitasking operating system, allows multiple users or processes to share the CPU by rapidly switching between tasks. It provides the illusion of concurrent execution, enhancing system responsiveness and efficiency

Conclusion

In conclusion, time-sharing operating systems facilitate efficient CPU sharing among multiple users or processes, enhancing productivity. Real-time operating systems, on the other hand, are designed to meet stringent timing requirements for critical applications, ensuring timely execution and reliability.

Recommended Readings: 


You can also consider our Operating System Course to give your career an edge over others.

Happy Learning!

Live masterclass