0% found this document useful (0 votes)
7 views3 pages

Scheduling Problems

The document outlines various scheduling algorithms in operating systems, including FCFS, Preemptive SJF, Non-Preemptive SJF, Round Robin, Priority Scheduling, and Multilevel Scheduling. It presents problems related to each algorithm, specifying process arrival times, burst times, and priorities where applicable. Additionally, it includes instructions for drawing Gantt charts and calculating waiting and turnaround times for the processes.

Uploaded by

kolarkarsami
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Scheduling Problems

The document outlines various scheduling algorithms in operating systems, including FCFS, Preemptive SJF, Non-Preemptive SJF, Round Robin, Priority Scheduling, and Multilevel Scheduling. It presents problems related to each algorithm, specifying process arrival times, burst times, and priorities where applicable. Additionally, it includes instructions for drawing Gantt charts and calculating waiting and turnaround times for the processes.

Uploaded by

kolarkarsami
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Questions:

1. Draw the Gantt chart for the schedule.


2. Calculate the waiting and turnaround times for each process.
3. What are the average waiting time and turnaround time for all processes?

Problem 1: FCFS (First-Come-First-Serve) scheduling algorithm.

Process Arrival Time Burst Time


P1 0 5
P2 2 3
P3 4 1
P4 6 2
P5 7 4

Problem 2: Preemptive SJF (Shortest Remaining Time First)

Process Arrival Time Burst Time


P1 0 ms 8 ms
P2 1 ms 4 ms
P3 2 ms 9 ms
P4 3 ms 5 ms

Problem 3: Non-Preemptive SJF

Process Arrival Time Burst Time


P1 0 ms 6 ms
P2 2 ms 2 ms
P3 4 ms 8 ms
P4 5 ms 3 ms

Problem 4: Round Robin Scheduling

Process Arrival Time Burst Time


P1 0 ms 5 ms
P2 1 ms 3 ms
P3 2 ms 8 ms
P4 3 ms 6 ms

Time Quantum = 3 ms
Problem 5: Priority Scheduling (Non-Preemptive)

Process Arrival Time Burst Time Priority


P1 0 ms 10 ms 3
P2 2 ms 5 ms 1
P3 4 ms 2 ms 4
P4 6 ms 8 ms 2

Note: Lower number = Higher priority (i.e., Priority 1 is highest)

Problem 6: Preemptive Priority Scheduling

Process Arrival Time Burst Time Priority


P1 0 ms 7 ms 2
P2 2 ms 4 ms 1
P3 4 ms 1 ms 3
P4 5 ms 5 ms 2
P5 6 ms 3 ms 1

Note: Lower number = Higher priority (i.e., Priority 1 is highest)

Problem 7: Multilevel Scheduling with Fixed Priority

Consider a system that uses the Multilevel Queue Scheduling Algorithm with Fixed Priority
Preemptive Scheduling. The system has three queues:

Queue 1 (System processes, Highest priority): Time Quantum = 2ms


Queue 2 (Interactive processes, Medium priority): Time Quantum = 4ms
Queue 3 (Batch processes, Lowest priority): FCFS (First-Come, First-Served, no time quantum)
A set of processes arrive as follows:

Process Arrival Time (ms) Burst Time (ms) Queue

P1 0 5 Queue 1

P2 2 7 Queue 2

P3 3 4 Queue 1

P4 5 10 Queue 3

P5 6 3 Queue 2

Problem 8: Multilevel Scheduling with Time Slicing

A system uses the Multilevel Queue Scheduling Algorithm with Time Slicing between queues (also
called "round-robin between queues"). There are three queues:
Queue 1 (Real-time processes, Highest priority): Time quantum per queue cycle = 4ms (inside queue:
Round Robin, time quantum per process = 2ms)

Queue 2 (Interactive processes, Medium priority): Time quantum per queue cycle = 4ms (Round Robin,
time quantum per process = 4ms)

Queue 3 (Batch processes, Lowest priority): FCFS (no time quantum; processes run until time slice for
queue expires)

At each scheduling cycle, the CPU allocates 4ms to each queue in turn (Queue 1 → Queue 2 → Queue
3 → repeat). Processes only run when their queue is active.
Processes arrive as follows:

Process Arrival Time (ms) Burst Time (ms) Queue

P1 0 5 Queue 1

P2 1 8 Queue 2

P3 2 6 Queue 1

P4 4 7 Queue 3

P5 5 4 Queue 2

You might also like