OS Week 2

Cards (8)

  • CPU Scheduling
    • It serves as an introduction to the concept of CPU scheduling in operating systems
    • CPU scheduling is a crucial aspect of operating systems that deals with the management of processes and their execution on the CPU
    • The primary goal of CPU scheduling is to maximize CPU utilization and system throughput while minimizing response time and waiting time for processes
    • Different scheduling algorithms are designed to achieve specific objectives, such as fairness, efficiency, and responsiveness
    • Understanding the background of CPU scheduling is essential for grasping the significance of various scheduling algorithms discussed in the document
  • Introduction to CPU scheduling in operating systems
    1. Importance of CPU scheduling for managing processes efficiently
    2. Goal of CPU scheduling: maximize CPU utilization, system throughput, minimize response time and waiting time
    3. Overview of different scheduling algorithms designed to achieve specific objectives
    4. Foundation for understanding advanced scheduling techniques like FCFS, SJF, RR, Priority Scheduling
    5. Significance of background knowledge in CPU scheduling for comprehending scheduling strategies and their impact on system performance
  • First-Come, First-Served (FCFS)

    • A simple CPU scheduling algorithm where processes are executed in the order they arrive
    • Each process is allocated the CPU based on its arrival time, forming a FIFO (First-In-First-Out) queue
    • Advantages of FCFS include its simplicity in implementation
    • Disadvantages of FCFS include potential large waiting times for short requests behind long ones and unsuitability for multiprogramming systems
    • In FCFS, a process holds the CPU until it completes its execution or gets blocked
    • FCFS is a non-preemptive algorithm, meaning once a process starts executing, it continues until completion
    • FCFS may not be suitable for batch systems or interactive systems due to its limitations in handling varying job lengths and responsiveness requirements
  • Shortest Job First (SJF)
    • SJF aims to minimize the average waiting time by prioritizing shorter jobs (small burst time) over longer ones
    • Advantages of SJF include reducing waiting times and improving system efficiency by executing shorter jobs first
    • Disadvantages of SJF include the challenge of accurately estimating burst times, especially for new or unpredictable tasks, and the potential for starvation of longer processes
    • SJF can be implemented in both preemptive and non-preemptive forms, allowing for flexibility in handling different types of processes
    • Understanding SJF is crucial for optimizing system performance & enhancing system responsiveness & overall efficiency by prioritizing shorter tasks and minimizing waiting times
    • SJF is a valuable scheduling algorithm in scenarios where job lengths are known or can be estimated accurately
  • Round-Robin (RR)

    • Processes are placed in a queue and each process is given a turn to execute for the quantum duration before being preempted
    • Round-Robin is a preemptive algorithm, ensuring fair CPU time distribution among processes
    • Advantages of Round-Robin include simplicity in implementation and suitability for multiprogramming systems
    • Disadvantages of Round-Robin include challenges in determining the optimal quantum value and the assumption that all processes are equally important
    • The quantum length in Round-Robin is typically between 10-100 milliseconds, allowing for fair sharing of CPU time among processes
    • Round-Robin is intuitive and ensures that each process gets a chance to execute regularly, preventing any single process from monopolizing the CPU
    • Understanding Round-Robin is essential for managing CPU scheduling in time-sharing systems and balancing the trade-offs between fairness and efficiency
    • Round-Robin is well-suited for scenarios where equal CPU time distribution is desired and responsiveness to user interactions is important
    • By dividing CPU time into fixed intervals, Round-Robin helps in preventing process starvation and maintaining system responsiveness
  • Priority Scheduling
    • Processes with higher priority are executed before those with lower priority
    • Priority can be defined based on factors like process type, importance, deadline, or other criteria
    • Priority Scheduling can be preemptive or non-preemptive, allowing higher priority processes to interrupt lower priority ones
    • Advantages of Priority Scheduling include the ability to prioritize important tasks and meet deadlines effectively
    • Disadvantages include the potential for lower priority processes to suffer from starvation if higher priority tasks constantly arrive
    • Priority Inversion can occur when a low priority task holds a resource needed by a high priority task, causing delays
    • Priority Aging can be implemented to gradually increase the priority of waiting processes, preventing starvation
    • Understanding Priority Scheduling is crucial for managing system resources efficiently and meeting task requirements based on importance
    • Priority Scheduling is suitable for real-time systems, where tasks have specific deadlines and priorities that need to be met
    • By assigning priorities to processes, Priority Scheduling helps in optimizing system performance and ensuring critical tasks are executed promptly
  • Types of Scheduling Algorithms
    • First-Come-First-Serve (FCFS)
    • Shortest Job First (SJF)
    • Shortest Remaining Time (SRT)
    • Round-Robin (RR)
    • Priority Scheduling
  • CPU Scheduling Basics:
       - CPU scheduling involves selecting a process from the ready queue to execute on the CPU.
       - The scheduler uses algorithms to determine the order in which processes are executed.
       - Preemptive scheduling allows a running process to be suspended, while non-preemptive scheduling requires a process to release the CPU only upon completion or blocking.