Operating System Tutorial

Operating System Tutorial Types of Operating System Evolution of Operating System Functions of Operating System Operating System Properties Operating System Services Components of Operating System Needs of the Operating System

Operating Systems

Linux Operating System Unix Operating System Ubuntu Operating System Chrome Operating Systems Fedora Operating System MAC Operating System MS Windows Operating System Solaris Operating System Cooperative Operating System CorelDRAW Operating System CentOS FreeBSD Operating Systems Batch Operating System MS-DOS Operating System Commercial Mobile Operating Systems

Differences

Difference Between Multi-programming and Multitasking Difference between C-LOOK and C-SCAN Difference between Rotational Latency and Disk Assess Time Trap vs Interrupt Difference between C-SCAN and SSTF Difference between SCAN and FCFS Difference between Seek Time and Disk Access Time Difference between SSTF and LOOK Difference between Process and Program in the Operating System Difference between Protection and Security in Operating System

How To

How to implement Monitors using Semaphores How to Install a Different Operating System on a PC

Questions

What is Kernel and Types of Kernel What is DOS Operating System What is Thread and Types of Thread What is Process Scheduler and Process Queue What is Context Switching What is CPU Scheduling What is Producer-Consumer Problem What is Semaphore in Operating System Monitors in Operating System What is Deadlock What is Paging and Segmentation What is Demand Paging What is Virtual Memory What is a Long term Scheduler What is Page Replacement in Operating System What is BSR Mode What is Convoy Effect What is Job Sequencing in Operating System Why is it critical for the Scheduler to distinguish between I/O-bound and CPU-bound programs Why is there a Need for an Operating System

Misc

Process Management Process State Scheduling Algorithm FCFS (First-come-First-Serve) Scheduling SJF (Shortest Job First) Scheduling Round-Robin CPU Scheduling Priority Based Scheduling HRRN (Highest Response Ratio Next) Scheduling Process Synchronization Lock Variable Mechanism TSL Mechanism Turn Variable Mechanism Interested Variable Mechanism Deadlock Avoidance Strategies for Handling Deadlock Deadlock Prevention Deadlock Detection and Recovery Resource Allocation Graph Banker’s Algorithm in Operating System Fixed Partitioning and Dynamic Partitioning Partitioning Algorithms Disk Scheduling Algorithms FCFS and SSTF Disk Scheduling Algorithm SCAN and C-SCAN Disk Scheduling Algorithm Look and C-Look Disk Scheduling Algorithm File in Operating System File Access Methods in Operating System File Allocation Method Directory Structure in Operating System N-Step-SCAN Disk Scheduling Feedback Queue in Operating System Contiguous Memory Allocation in Operating System Real-time Operating System Starvation in Operating System Thrashing in Operating System 5 Goals of Operating System Advantages of Operating System Advantages of UNIX Operating System Bit Vector in Operating System Booting Process in Operating System Can a Computer Run Without the Operating System Dining Philosophers Problem in Operating System Free Space Management in Operating System Inter Process Communication in Operating System Swapping in Operating System Memory Management in Operating System Multiprogramming Operating System Multitasking Operating Systems Multi-user Operating Systems Non-Contiguous Memory Allocation in Operating System Page Table in Operating System Process Scheduling in Operating System Segmentation in Operating System Simple Structure in Operating System Single-User Operating System Two Phase Locking Protocol Advantages and Disadvantages of Operating System Arithmetic operations in binary number system Assemblers in the operating system Bakery Algorithm in Operating System Benefits of Ubuntu Operating System CPU Scheduling Criteria in Operating System Critical Section in Operating System Device Management in Operating System Linux Scheduler in Operating System Long Term Scheduler in Operating System Mutex in Operating System Operating System Failure Peterson's Solution in Operating System Privileged and Non-Privileged Instructions in Operating System Swapping in Operating System Types of Operating System Zombie and Orphan Process in Operating System 62-bit operating system Advantages and Disadvantages of Batch Operating System Boot Block and Bad Block in Operating System Contiguous and Non - Contiguous Memory Allocation in Operating System Control and Distribution Systems in Operations Management Control Program in Operating System Convergent Technologies in Operating System Convoy Effect in Operating System Copy Operating Systems to SSD Core Components of Operating System Core of UNIX Operating System Correct Value to return to the Operating System Corrupted Operating System Cos is Smart Card Operating System Cosmos Operating Systems Examples Generation of Operating System Hardware Solution in Operating System Process Control Block in Operating System Function of Kernel in Operating System Operating System Layers History of Debian Operating Systems Branches and Architecture of Debian Operating Systems Features and Packages of Debian Operating Systems Installation of Operating System on a New PC Organizational Structure and Development in Debian Operating Systems User Interface in Operating System Types Of Memory in OS Operating System in Nokia Multilevel Paging in OS Memory Mapping Techniques in OS Memory Layout of a Process in Operating System Hardware Protection in Operating System Functions of File Management in Operating System Core of Linux Operating System Cache Replacement Policy in Operating System Cache Line and Cache Size in Operating System What is Memory Mapping? Difference Between Network Operating System And Distributed Operating System What is the difference between a Hard link and a Soft Link? Principles of Preemptive Scheduling Process Scheduling Algorithms What is NOS? What is the Interrupt I/O Process? What is Time Sharing OS What is process termination? What is Time-Sharing Operating System What is Batch File File system manipulation What is Message-passing Technique in OS Logical Clock in Distributed System

Long Term Scheduler in Operating System

The Long Term Scheduler, also known as the job scheduler, is an operating system component that selects a limited number of processes from the pool of available jobs and brings them into the system for processing. It is responsible for assigning memory and other resources to the selected processes and decides which processes should be admitted into the system. The Long Term Scheduler helps to ensure that the system remains efficient and is manageable with too many processes. It is a crucial component of any operating system that helps to balance the workload and optimize resource utilization.

Importance of the Long Term Scheduler

Following is the list of the key importance of the long-term scheduler:

  1. Resource allocation: The long-term scheduler determines which programs should be executed based on the available system resources such as memory, CPU, and I/O devices.
  2. System throughput: The long-term scheduler is responsible for selecting programs that optimize the system's throughput. It schedules programs to maximize the number of jobs executed within a given period.
  3. Fairness: The long-term scheduler ensures that all users are treated fairly by selecting programs to balance the needs of all users.
  4. Response time: The long-term scheduler affects the system's response time by selecting programs that can execute in a timely manner.
  5. Overhead reduction: The long-term scheduler helps in reducing overhead by selecting programs that can efficiently use the system resources.

Functions of Long Term Scheduler

The Long Term Scheduler has several important functions that are critical to the efficient operation of an operating system.

Let's understand each of these functions in detail:

  1. Selecting processes from Job Pool: The long-term scheduler selects processes from the job pool, a queue of all the programs waiting to be executed. The selection of processes is based on various factors, such as the priority of the process, the availability of resources, and the time when the process was submitted.
    For example, suppose there are 100 jobs submitted to the system. In that case, the Long Term Scheduler may only select the top 10 processes to be admitted into the system based on their priority or estimated execution time.
  2. Allocating resources to the selected processes: After selecting the processes, the long-term scheduler allocates resources to these processes. These resources may include memory, CPU, and I/O devices. The long-term scheduler ensures that the resources are allocated efficiently to maximize the system's throughput and minimize the response time.
    For example, consider a computer system with limited memory and multiple processes waiting to be executed. The long-term scheduler allocates the memory to the selected processes to maximize the system's performance and minimize the response time.
  3. Loading the selected processes into memory: Once the long-term scheduler has selected the processes and allocated the resources, it loads the established processes into memory. The long-term scheduler ensures that the processes are loaded into memory efficiently and in a way that minimizes the response time.
    For example, suppose there are two processes that require 1GB of memory each. In that case, the Long Term Scheduler may load them into memory to ensure they are located next to each other to minimize fragmentation.

Criteria for Selection

  1. Process Characteristics: The long-term scheduler selects processes based on their characteristics, such as the type of process, its priority, and its estimated execution time.
    For example, consider a computer system where some processes are I/O bound and others are CPU bound. The long-term scheduler may prioritize I/O bound processes as they spend most of their time waiting for I/O operations to complete. This can improve the overall system throughput as it allows the CPU to be utilized by other processes.
  2. Resource Availability: The long-term scheduler selects processes based on the availability of resources such as memory, CPU, and I/O devices.
    For example, consider a computer system with limited memory. The long-term scheduler may select processes that require less memory to execute to ensure enough memory is available for other processes.
  3. System Load: When selecting processes, the long-term scheduler considers the current system load. It selects processes that can execute without causing a significant increase in the system load.
    For example, consider a computer system with high CPU utilization due to several processes running simultaneously. The long-term scheduler may select processes requiring less CPU utilization to ensure the system load does not increase significantly.

Long Term Scheduling Algorithms

  1. First-Come-First-Serve (FCFS): FCFS is one of the simplest long-term scheduling algorithms. In FCFS, the long-term scheduler selects the process from the job pool based on their arrival time. Every process that comes first is carried out first, and so on.
    For example, a computer system that has several processes awaiting execution. The long-term scheduler selects the process that arrived first and allocated the required resources to execute the process.
  2. Shortest Job Next (SJN): SJN is a long-term scheduling algorithm that selects the process with the shortest estimated execution time from the job pool. SJN ensures that the processes that require less execution time are executed first, which can improve the system's throughput and reduce the average waiting time.
    For example, consider a computer system that has several processes waiting to be executed. The long-term scheduler selects the process with the shortest estimated execution time and allocates the required resources to execute the process.
  3. Priority-Based Scheduling: Priority-based scheduling is a long-term scheduling algorithm that selects the process based on its priority. Each process is assigned a priority level based on its importance, and the long-term scheduler selects the process with the highest priority for execution. Priority-based scheduling ensures that the most critical processes are executed first, which can improve the system's performance.
    For example, consider a computer system where some processes are more important than others. The long-term scheduler assigns a priority level to each process based on its importance and selects the process with the highest priority for execution.
  4. Round-Robin Scheduling: Round-robin scheduling is a long-term scheduling algorithm that allocates a fixed time slice to each process. The long-term scheduler selects the process from the job pool and allocates the required resources to execute the process for a specified time slice. If a process's execution cannot be completed within the allotted time slice, it is preempted, and the subsequent process is run instead. Round-robin scheduling ensures that each process gets an equal share of the system's resources.
    For example, consider a computer system with multiple processes waiting to be executed. The long-term scheduler selects the process and allocates a fixed time slice to execute the process. If the operation completes its execution within the given time slice, the next process is selected for execution. If a process's execution cannot be completed within the allotted time slice, it is preempted, and the subsequent process is run instead.

Advantages of Long Term Scheduler

  • Optimizes system throughput: The long-term scheduler ensures that the selected processes can execute efficiently without causing a significant increase in the system load. This can improve the overall system throughput by using the available resources better.
  • Helps prevent resource starvation: The long-term scheduler ensures that the selected processes have access to the required resources such as memory, CPU, and I/O devices. This helps prevent resource starvation, where some processes do not have access to the needed resources, which can lead to poor system performance.
  • Allows for better resource management: The long-term scheduler selects processes based on process characteristics, resource availability, and system load. This allows for better resource management by ensuring that the chosen processes can execute efficiently without causing a significant increase in the system load.

Disadvantages of Long Term Scheduler

  • Can lead to increased waiting time for some processes: The long-term scheduler may select processes that require a significant amount of time to execute, which can lead to increased waiting time for other operations. This can lead to poor system performance and a decrease in overall system throughput.
  • Can cause process starvation for some processes: The long-term scheduler may prioritize some processes over others, which can lead to process starvation for some operations. This can lead to poor system performance and a decrease in overall system throughput.

Conclusion

The long-term scheduler is a critical component of any operating system that determines the order in which processes are selected from the job pool for execution. It plays an essential role in optimizing system throughput, preventing resource starvation, and allowing for better resource management.

Future developments in long-term scheduling include the use of machine learning algorithms to predict the execution time of processes and allocate resources more efficiently. This can improve the system's performance by reducing process waiting time and improving the overall system throughput. Additionally, advancements in hardware technology, such as multi-core processors and solid-state drives, may require new long-term scheduling algorithms to take advantage of these hardware features.

Overall, the long-term scheduler is a crucial component of any operating system. Its importance will grow as the demand for efficient resource management and system performance increases. Future developments in long-term scheduling will continue to improve the efficiency and performance of operating systems, making them more capable of handling increasingly complex computing tasks.