If you have any suggestions about our website or study materials, please feel free to leave a comment to help us improve. Alternatively, you can send us a message through the Contact Us page. Thank you for helping us make Free Study Hub better!

Unit II: CPU Scheduling

 

Unit II: CPU Scheduling

  1. What is the primary purpose of CPU scheduling in an operating system?
    A. Allocating memory to processes
    B. Managing input/output operations
    C. Distributing CPU time among multiple processes
    D. Providing a user interface
    Answer: C. Distributing CPU time among multiple processes
    Explanation: CPU scheduling ensures efficient CPU utilization by allocating CPU time to processes waiting in the ready queue.

  2. Which scheduling algorithm assigns the CPU to the process that arrives first in the ready queue?
    A. Shortest Job First (SJF)
    B. Round Robin (RR)
    C. First-Come, First-Served (FCFS)
    D. Priority Scheduling
    Answer: C. First-Come, First-Served (FCFS)
    Explanation: FCFS scheduling processes in the order they arrive, providing simplicity but may lead to inefficiencies like the convoy effect.

  3. What is the main disadvantage of the First-Come, First-Served (FCFS) scheduling algorithm?
    A. It is difficult to implement
    B. It may lead to a phenomenon known as "convoy effect"
    C. It favors short processes over long processes
    D. It requires a large amount of memory
    Answer: B. It may lead to a phenomenon known as "convoy effect"
    Explanation: The convoy effect occurs when a long process delays the execution of shorter processes in the queue.

  4. Which scheduling algorithm aims to minimize the total time a process spends waiting in the ready queue?
    A. First-Come, First-Served (FCFS)
    B. Shortest Job First (SJF)
    C. Priority Scheduling
    D. Round Robin (RR)
    Answer: B. Shortest Job First (SJF)
    Explanation: SJF prioritizes processes with shorter burst times, reducing the average waiting and turnaround time.

  5. In Round Robin scheduling, what is the significance of the time quantum or time slice?
    A. It is the maximum burst time allowed for a process
    B. It is the time a process is allowed to run before being preempted
    C. It is the total time a process spends in the ready queue
    D. It is the time required to switch between processes
    Answer: B. It is the time a process is allowed to run before being preempted
    Explanation: The time quantum ensures fairness in CPU allocation, allowing each process a fixed duration of execution before preemption.

  6. What is the key characteristic of a preemptive scheduling algorithm?
    A. Processes cannot be interrupted once they start executing
    B. Processes can be interrupted and moved back to the ready queue
    C. Processes are assigned a fixed time slice for execution
    D. Processes are executed in the order they arrive in the ready queue
    Answer: B. Processes can be interrupted and moved back to the ready queue
    Explanation: Preemptive scheduling allows the operating system to interrupt a running process to prioritize higher-priority tasks.

  7. What is the role of a Dispatcher in the context of CPU scheduling?
    A. Allocates memory to processes
    B. Manages input/output operations
    C. Selects a process from the ready queue for execution
    D. Provides a user interface
    Answer: C. Selects a process from the ready queue for execution
    Explanation: The dispatcher is responsible for transferring control of the CPU to the selected process from the ready queue.

  8. In Priority Scheduling, how is priority assigned to processes?
    A. By the order in which processes arrive
    B. By the total time a process has spent in the ready queue
    C. By the burst time of a process
    D. By a predefined priority value associated with each process
    Answer: D. By a predefined priority value associated with each process
    Explanation: Priority Scheduling assigns CPU time based on a priority value, where higher-priority processes are executed first.

  9. What is the primary advantage of Round Robin (RR) scheduling over First-Come, First-Served (FCFS)?
    A. Lower average waiting time
    B. Fairness in CPU allocation
    C. Simplicity of implementation
    D. Improved throughput
    Answer: B. Fairness in CPU allocation
    Explanation: Round Robin scheduling ensures that all processes get an equal share of CPU time, preventing starvation.

  10. What scheduling algorithm allows a process to be executed only if its priority is higher than the priority of the currently executing process?
    A. Round Robin (RR)
    B. Priority Scheduling
    C. Shortest Job First (SJF)
    D. First-Come, First-Served (FCFS)
    Answer: B. Priority Scheduling
    Explanation: Preemptive Priority Scheduling interrupts the currently running process if a higher-priority process arrives.

  1. What is the primary disadvantage of Priority Scheduling?
    A. It may lead to starvation of low-priority processes
    B. It favors short processes over long processes
    C. It requires a large amount of memory
    D. It is difficult to implement
    Answer: A. It may lead to starvation of low-priority processes
    Explanation: Priority Scheduling can cause starvation, where low-priority processes may never get CPU time if higher-priority processes continuously arrive.

  2. Which scheduling algorithm is designed to handle both real-time and non-real-time processes?
    A. Priority Scheduling
    B. Round Robin (RR)
    C. Multi-level Feedback Queue
    D. First-Come, First-Served (FCFS)
    Answer: C. Multi-level Feedback Queue
    Explanation: Multi-level Feedback Queue scheduling dynamically adjusts process priorities and can handle both real-time and non-real-time processes.

  3. What is the purpose of a multiprocessor scheduling algorithm in an operating system?
    A. Distributing CPU time among multiple processes
    B. Managing input/output operations
    C. Allocating memory to processes
    D. Coordinating the execution of processes on multiple CPUs
    Answer: D. Coordinating the execution of processes on multiple CPUs
    Explanation: Multiprocessor scheduling ensures efficient load balancing and CPU utilization across multiple processors.

  4. Which scheduling criterion aims to achieve maximum CPU utilization and throughput?
    A. CPU Burst Time
    B. Turnaround Time
    C. Response Time
    D. Fairness
    Answer: A. CPU Burst Time
    Explanation: Minimizing CPU burst time directly contributes to improved CPU utilization and increased throughput.

  5. In real-time scheduling, what is the primary concern?
    A. Maximum CPU utilization
    B. Fairness in CPU allocation
    C. Meeting deadlines
    D. Minimizing turnaround time
    Answer: C. Meeting deadlines
    Explanation: Real-time scheduling ensures tasks meet their deadlines, which is critical in systems like embedded and industrial controls.

  6. What is the primary goal of the Shortest Job First (SJF) scheduling algorithm?
    A. Minimizing turnaround time
    B. Maximizing CPU utilization
    C. Fairness in CPU allocation
    D. Minimizing waiting time
    Answer: A. Minimizing turnaround time
    Explanation: SJF reduces the average turnaround time by prioritizing processes with the shortest execution time.

  7. In multiprocessor scheduling, what is load balancing?
    A. Allocating memory to processes
    B. Distributing processes among multiple CPUs to ensure equal workload
    C. Selecting processes based on their priority
    D. Coordinating the execution of processes on multiple CPUs
    Answer: B. Distributing processes among multiple CPUs to ensure equal workload
    Explanation: Load balancing aims to evenly distribute the computational workload across multiple processors.

  8. What is the primary characteristic of a non-preemptive scheduling algorithm?
    A. Processes can be interrupted and moved back to the ready queue
    B. Once a process starts executing, it cannot be interrupted
    C. Processes are assigned a fixed time slice for execution
    D. Processes are executed in the order they arrive in the ready queue
    Answer: B. Once a process starts executing, it cannot be interrupted
    Explanation: Non-preemptive scheduling ensures a process completes its execution without interruption once it starts.

  9. What is the purpose of a Multi-level Feedback Queue in CPU scheduling?
    A. Assigning priorities to processes
    B. Distributing CPU time among multiple processes
    C. Handling both real-time and non-real-time processes
    D. Adapting to the behavior of processes by adjusting priority levels
    Answer: D. Adapting to the behavior of processes by adjusting priority levels
    Explanation: Multi-level Feedback Queues dynamically adjust process priorities based on their execution history and behavior.

  10. Which thread scheduling algorithm allows a thread to run until it voluntarily releases the CPU?
    A. Preemptive Scheduling
    B. Non-preemptive Scheduling
    C. Round Robin Scheduling
    D. Priority Scheduling
    Answer: B. Non-preemptive Scheduling
    Explanation: In non-preemptive thread scheduling, the thread voluntarily relinquishes the CPU only when it completes or requires waiting.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.