Unit 2,3 Ct2 Question Bank 4 Marks
Unit 2,3 Ct2 Question Bank 4 Marks
Unit 2,3 Ct2 Question Bank 4 Marks
4 MARKS
12 MARKS:
1. State dining philosopher’s problem and give a solution using semaphores. Write structure
of philosopher.
2. Explain in detail solution criteria for critical section problem and the algorithms for
handling two process CS problem
3. What are semaphores? Explain solution to producer-consumer problem using semaphores
4. Consider the following set of processes, with the arrival times and the CPU-burst times
given in milliseconds
Process Arrival Time Burst Time
P1 0 5
P2 1 3
P3 2 3
P4 4 1
5. What is the average turnaround and waiting time for these processes with the preemptive
shortest remaining processing time first (SRPT) algorithm and round robin with quantum
time of 2 ms ? Draw the Gantt Chart
6. Consider the following set of processes, with the arrival times and the CPU-burst times
given in milliseconds
Process Arrival Time Burst Time Priority
P1 0 6 2
P2 1 2 2
P3 1 3 4
P4 2 1 1
P5 2 2 3
Give a Gantt chart illustrating the execution of the five processes using FCFS, RR (quantum
time =3) and Priority. Which algorithm gives minimum average waiting and turnaround time.
7. Consider the following five processes, with the length of CPU burst time given in
milliseconds
Proces Arriva Burs
s l time t
time
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
Consider the FCFS, round robin(Quantum =1ms)scheduling algorithms.Illustrate using Gantt
chart. Which algorithm will give minimum average waiting time? Discuss.
8. Explain the banker's algorithm for deadlock avoidance.
9. What is Deadlock? Discuss the necessary condition for deadlock Explain Resource
allocation graph.Explain the deadlock prevention methods in detail.
10. Given the following state for the Banker’s Algorithm.
5 processes P0 through P4 , 3 resource types:
A (10 instances); B (5 instances); C (7 instances);
Calculate the Need matrix
How that the current state is safe, that is, show a safe sequence of processes
12. Determine whether the given state is safe or not using deadlock avoidance algorithm.
Claim Allocation Resource vector Available vector
ABC | ABC | ABC | A BC
322 10 0 936 011
613 612
314 2l 1
422 002
13. Given memory partition of 20 KB, 100 KB, 40 KB, 200 KB and 10 KB (in order). Show
with neat Sketch how would each of the first-fit, best-fit and worst-fit algorithms place
processes of 90 KB, 50 KB, 30 KB and 40 KB(in order). Which algorithm is most
efficient in memory allocation?
14. Given memory partition of 100 KB, 500 KB, 200 KB and 600 KB (in order). Show with
neat Sketch how would each of the first-fit, best-fit and worst-fit algorithms place
processes of 412 KB,317 KB, 112 KB and 326 KB(in order). Which algorithm is most
efficient in memory allocation?
15. Briefly explain the commonly used techniques for structing page table.
16. Why are translation look aside buffer important? Explain address translation with TLB