Assignment 2
Assignment 2
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:
P1 0 5
P2 1 3
P3 2 8
P4 3 6
P1 0 6 3
P2 1 8 1
P3 2 7 4
P4 3 3 2
P1 0 10
P2 1 5
P3 2 8
P4 3 4
P1 0 7
P2 2 4
P3 4 1
P4 5 3
Find:
P2 1 4
P3 2 9
P4 3 5
Given processes:
P2 2 4 2
P3 4 5 1
P4 5 2 2
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).
What are the conditions under which deadlock can occur due to
scheduling?