What is Time-Sharing Operating System
Introduction
An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is a crucial component of the system software in a computer system.
Batch Operating system is one of the important types of operating system.
Users using a batch operating system do not interact with the computer directly. Each user prepares their job on an off-line device like a punch card and submits it to the computer operator. Jobs with similar needs are batched together and run as a group to speed up the processing. The programmers exit their programs with the operator, and the operator then sorts the programs with similar requirements into batches.
The following are the issues that arise with batch systems:
- The user and the task are not interacting with each other.
- Due to the mechanical I/O devices' slower speed than the CPU, the CPU is frequently idle.
- It is challenging to assign the appropriate priority.
Types of Operating Systems
The following are the various kinds of operating systems:
- Batch Operating System
- Multiprogramming Operating System
- Time Sharing Operating System
- Multiprocessing Operating System
- Real-time Operating System
Let's talk about the Time-Sharing Operating System now.
Time-Sharing operating system
An operating system design known as time-sharing permits several users or processes to simultaneously use the same system resources, including the CPU, memory, and peripherals. It makes it possible for every user or process to appear as though they have exclusive access to the system while efficiently sharing resources in a time-sliced fashion.
User interaction with computer systems was impossible with multiprogrammed, batch systems, but they offered an environment where different system resources were used efficiently. A natural progression from multiprogramming is time-sharing. Interaction between the user and each running program is possible because the CPU switches between many tasks so frequently. Several people can share computers at once with a time-shared operating system. Because the shared system shrinks with each action or order, each user only needs a small amount of CPU time. Even though several users share the computer system, each user gets the impression that it is exclusively theirs as the system quickly flips between them.
Each user of a time-shared operating system is given access to a small portion of the shared computer simultaneously through CPU scheduling and multi-programming. In memory, every user possesses a minimum of one distinct program. An application is loaded into memory and runs for a brief amount of time, either to finish the I/O or to reach its conclusion. Quantum, time slice, and time slot are terms used to describe this brief time window when the user receives CPU attention. The usual duration is between 10 and 100 milliseconds. Comparing multiprogrammed and time-shared operating systems, the latter are simpler. Memory management and security are necessary since numerous tasks must be maintained while running in parallel. Jobs may need to switch in and out of the disc from the main memory, which is now used as a backup store for the main memory, to get a good response time. Virtual memory, a technique that enables the execution of a job that might not be entirely in memory, is a popular way to accomplish this goal.
Three key states of Time-Sharing Operating System
Below is a list of the three critical states of the time-sharing operating system.
- Active State: When a process is actively using the CPU, it is said to be active. Only one process can be in the active state at a time because the CPU can only be assigned to one process for processing at a time.
- Ready State: A process that is ready to run and is awaiting a CPU assignment is referred to as being in the "ready state." Even though multiple processes can exist simultaneously in the ready state, only one will ever use the CPU to process data.
- Waiting State: In a state known as "waiting," processes are those that are not ready to run just yet and are waiting for an input/output process to finish. When the input/output process is complete, it leaps to the ready state, ready to be executed.
In the above figure, user 5 is in an active state, while users 1, 2, 3, and 4 are waiting, and user 6 is in a ready state.
In the active state, the CPU controls the user's program. In this state, there is only one programme offered.
Ready State: The user program is prepared to run and merely awaits its CPU turn. Multiple users can be in a ready state simultaneously.
The user's program is waiting while it awaits an input or output operation. Multiple users can be in a waiting state simultaneously.
Multiprogramming and CPU scheduling are two concepts used by time-sharing operating systems. The operating system can accomplish multiple tasks simultaneously by constantly switching the processor between multiple programs.
If the system contains three processes, P1, P2, and P3, the operating system will force the processor to run each process briefly until an input or output request is received. We call this brief window of time when the user has the CPU's focus "quantum," "time slice," or "time slot." Usually, it takes between ten and one hundred milliseconds. Each process thus uses the processor for a certain amount of time, and this cycle is continued until every process is finished. CPU scheduling determines which processes will receive the CPU in what order.
Another important thing to keep in mind is that the processor switches between processes so quickly that we are unable to determine which one is running at any given time. It seems as though every process is happening at the same time.
Examples of time-sharing operating systems
For instance, all processor types in a transaction processing system can complete every user program in a brief computational burst. For example, if n users exist, each user can obtain a time quantum.
The following are a few instances of time-sharing operating systems:
- UNIX
- Multics
- Linux
- Windows 2000 server
- Windows NT server
- TOPS-10 (DEC)
- TOPS-20 (DEC)
Requirements for Time-Sharing OS
The Time-Sharing Operating System needs an alarm clock that triggers the CPU with an interrupt signal after each time slice. A memory protection mechanism keeps data and instructions from one job from affecting others.
Two of the most important features of a time-sharing operating system are its ability to support many users simultaneously and speed up user response times overall. Additionally, time-sharing operating systems might be more affordable for businesses because they allow multiple users to use the system without requiring separate licence purchases.
Features of Time Sharing operating system
- Every user allocates a specific amount of time for every operation.
- The same computer can be used concurrently by several online users.
- End users consider themselves to be in total control of the computer system.
- There is an improvement in user-computer interaction.
- Responses to user inquiries may come back quickly.
- Waiting for the previous task to finish before using the processor is no longer necessary.
- It can complete a lot of tasks quickly.
Advantages of Timesharing operating systems
- It provides the advantage of quick response.
- This type of operating system avoids duplication of software.
- It reduces CPU idle time.
Disadvantages of Time-sharing operating systems are
- Time-sharing has the problem of reliability.
- Questions of security and integrity of user programs and data can be raised.
- The problem of data communication occurs.
Key Takeaways
Multi-programmed operating systems are less complicated than time-shared operating systems. In both cases, multiple jobs must be held in memory at the same time. Time-sharing is a logical extension of multiprogramming; under this operating system, several users/processes are assigned computer resources in time slots. Because the processor's time is shared across several users, it is a time-sharing operating system. As a result, memory management and security are required in the system.
Multiprogramming and time-sharing would be hard to implement without interrupts. A busy wait would be needed so that one job could not run while another was waiting for I/O. Time slices cannot be formed to divide the CPU among jobs without a timer interrupt. Interrupts must be coordinated with one another.
The next natural step after multiprogramming is time sharing. Many users/processes are allotted IT resources in different time slots under this time-sharing operating system.
Multiple people split up the processor's time. That's the reason it's called a time-sharing OS. A CPU in each user's terminal can be used for this purpose by two or more people. Within an OS that shares time, there is a set time slice. In an OS system that shares resources, executive power is turned off before the end of execution. Here, the time required for each process is the same or less. The operating system uses the available time to switch between processes in time-sharing. Within the system model of the time-sharing system, there are numerous users and applications. The time-sharing scheme optimises response time.