Operating System: Question Set – 05

Operating System: Question Set – 05

What is process scheduling in operating systems?

The operating system activity that chooses which process will execute at a specific time is known as process scheduling. By controlling the execution of several programs, it guarantees effective CPU use and offers multitasking.

What are the types of process scheduling?

  • Long-term scheduling: Selects which job pool processes are added to the ready queue.
  • Short-term scheduling: Which process in the ready queue will use the CPU next is determined by short-term scheduling, also known as CPU scheduling.
  • Medium-term scheduling: Manages the level of multitasking by suspending or restarting processes (swap in/out).

What are the goals of process scheduling?

  • Maximize CPU utilization.
  • Minimize waiting time.
  • Minimize turnaround time.
  • Minimize response time.
  • Ensure fairness among processes.

What is the difference between preemptive and non-preemptive scheduling?

  • Preemptive scheduling, such as Round Robin or Priority Scheduling with preemption, allows the CPU to be removed from a process before it completes its execution.
  • Non-preemptive scheduling, such as First-Come-First-Served or Shortest Job First, ensures that a process is completed once it begins.

What are some common scheduling algorithms?

  • First-Come-First-Served (FCFS): Processes are executed in the order they arrive.
  • Shortest Job Next (SJN): Executes the process with the shortest CPU burst time.
  • Round Robin (RR): Allocates a fixed time slice to each process in a cyclic order.
  • Priority Scheduling: Executes processes based on priority.
  • Multilevel Queue Scheduling: Divides processes into different queues based on categories (e.g., interactive vs. batch).
  • Multilevel Feedback Queue Scheduling: Processes can move between queues based on behavior and execution history.

What is context switching?

To enable multitasking, context switching involves loading the state of one process while storing the state of another that is currently running. Because it saves registers, program counters, and other process-specific data, it has overhead.

What is starvation in process scheduling? How can it be avoided?

Because high-priority activities consume the majority of CPU resources, starvation happens when low-priority processes are perpetually delayed.
Solution: The aging mechanism, which raises a process’s priority as it spends more time in the queue.

What is throughput in process scheduling?

Throughput is the number of processes completed per unit of time. Higher throughput is an indicator of better CPU utilization.

What is turnaround time, waiting time, and response time?

Turnaround Time: Total time taken from process submission to completion

Turnaround Time: Total time taken from process submission to completion

Response Time: Time taken from process submission to the first response.

What is the difference between CPU-bound and I/O-bound processes?

  • CPU-bound processes: Spend more time performing computations and require significant CPU time.
  • I/O-bound processes: Spend more time performing input/output operations and less CPU time.
    Scheduling should balance both types to optimize CPU and device utilization.

What is the dispatcher in process scheduling?

The dispatcher is a component of the operating system responsible for:

  1. Switching the CPU to the process selected by the short-term scheduler.
  2. Performing context switching.
  3. Setting up the user mode.
  4. Resuming the process’s execution.

How does Round Robin scheduling handle process starvation?

Round Robin scheduling assigns each process a fixed time slice (quantum). Processes are executed in cyclic order, ensuring that no process is indefinitely delayed, thus avoiding starvation.

What is a Gantt chart in process scheduling?

  • Process scheduling is shown graphically in a Gantt chart.
  • It helps in the computation of metrics like waiting time, turnaround time, and reaction time by displaying the sequence and timeline of process execution.

What is the time quantum in Round Robin scheduling, and how does it affect performance?

The time quantum is the fixed time each process gets to execute in Round Robin scheduling.

  • Small quantum: Better responsiveness but higher context-switch overhead.
  • Large quantum: Reduced overhead but poorer responsiveness and potential for starvation

What are multilevel queue scheduling and its drawbacks?

Multilevel queue scheduling divides processes into separate queues based on priority or type (e.g., system, interactive, batch). Each queue can have its scheduling algorithm.
Drawbacks:

  • Can lead to starvation if lower-priority queues are neglected.
  • Requires careful configuration of priorities and time slices.

Leave a Reply

Your email address will not be published. Required fields are marked *