0% found this document useful (0 votes)
18 views

Assignment 2

The document outlines an assignment for an Operating Systems course, focusing on various concepts related to mutual exclusion, process scheduling, and inter-process communication. It includes questions on algorithms, scheduling methods, and their implications on performance metrics such as waiting time and turnaround time. Additionally, it covers theoretical concepts like priority inversion, aging, and deadlock conditions.

Uploaded by

zojeridy
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)
18 views

Assignment 2

The document outlines an assignment for an Operating Systems course, focusing on various concepts related to mutual exclusion, process scheduling, and inter-process communication. It includes questions on algorithms, scheduling methods, and their implications on performance metrics such as waiting time and turnaround time. Additionally, it covers theoretical concepts like priority inversion, aging, and deadlock conditions.

Uploaded by

zojeridy
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
You are on page 1/ 7

Operating Systems (202040402)

Assignment-2
Submission Date:

Sr No Learning
Questions CO
Level
1
1.​ What is the difference between busy waiting and
blocking in mutual exclusion?
2.​ How does Peterson’s Algorithm ensure mutual exclusion
between two processes?
3.​ Which mutual exclusion mechanism is NOT suitable for
multiprocessor systems?
4.​ Consider a semaphore S = 3. If 5 processes try to enter
the critical section simultaneously, how many will be
blocked?
5.​ In a producer-consumer problem, how can you
implement IPC using semaphores?
6.​ What are the four necessary conditions of a critical
section problem?
7.​ How do mutex locks prevent race conditions?

2
1.​ Consider the following set of processes with their arrival
and burst times:

Process Arrival Time Burst Time

P1 0 5

P2 1 3
P3 2 8

P4 3 6

Find the average waiting time and average turnaround time


using FCFS scheduling, Shortest Job Next (SJN) scheduling
(non-preemptive).

with a time quantum of 2 units.Find the average waiting time


and average turnaround time using Round Robin (RR)
scheduling.

2.​ Consider the following set of processes with priorities:

Process Arrival Time Burst Time Priority

P1 0 6 3

P2 1 8 1

P3 2 7 4

P4 3 3 2

Compute the average waiting time and average turnaround


time using Priority Scheduling (preemptive & non-preemptive).
3.​ Consider the following set of processes:

Process Arrival Time Burst Time

P1 0 10

P2 1 5

P3 2 8

P4 3 4

Find the following using First-Come, First-Served (FCFS)


Scheduling

Completion Time (CT)

Turnaround Time (TAT)

Waiting Time (WT)

Average Turnaround Time

Average Waiting Time

4. Consider the following processes scheduled using SJF


(Non-Preemptive):
Process Arrival Time Burst Time

P1 0 7

P2 2 4

P3 4 1

P4 5 3

Find:

Completion Time (CT)

Turnaround Time (TAT)

Waiting Time (WT)

Average TAT and WT

5. A system has the following processes scheduled using


Shortest Remaining Time First (SRTF) - Preemptive Scheduling

Process Arrival Time Burst Time


P1 0 8

P2 1 4

P3 2 9

P4 3 5

Calculate Completion Time (CT), Turnaround Time (TAT), and


Waiting Time (WT) using Shortest Remaining Time First
(SRTF) scheduling.

Compute the average turnaround time and average waiting


time.

6. Multi-Level Queue (MLQ) Scheduling

A system uses Multilevel Queue Scheduling with two queues:

Queue 1 (Foreground): Uses Round Robin (Time Quantum = 3


ms)

Queue 2 (Background): Uses FCFS

Given processes:

Process Arrival Time Burst Time Queue


P1 0 7 1

P2 2 4 2

P3 4 5 1

P4 5 2 2

Compute Completion Time (CT), Turnaround Time (TAT), and


Waiting Time (WT).

Draw the Gantt Chart.

Compute average turnaround time and average waiting time.

3
1.​ What are the differences between preemptive and
non-preemptive scheduling?
2.​ Explain priority inversion and how it can be resolved.
3.​ What is CPU-I/O burst cycle, and how does it affect
scheduling decisions?
4.​ Explain convoy effect in FCFS scheduling.
5.​ What are the advantages and disadvantages of
multilevel queue scheduling?
6.​ Compare Round Robin (RR) scheduling with Multilevel
Feedback Queue (MLFQ).

How does aging help in reducing starvation in scheduling?

What is the difference between short-term, long-term, and


medium-term scheduling?
What are the conditions under which priority scheduling leads
to starvation?

Explain the effect of time quantum in Round Robin scheduling.

What is the role of the Dispatcher in process scheduling?

Compare FIFO, Round Robin, and Shortest Remaining Time


First (SRTF) scheduling.

What are the conditions under which deadlock can occur due to
scheduling?

You might also like