Cs2411 Operating Systems Cat 2
Cs2411 Operating Systems Cat 2
2) 3) 4) 5) 6)
What is a semaphore? Define deadlock. What are a safe state and an unsafe state? What is a resource-allocation graph? What is bankers algorithm? Difference between Preemptive and Non-Premptive. PART B
1. Explain what semaphores are, their usage, implementation given to avoid busy waiting and binary semaphores. 2. Explain about critical regions and monitors 3. Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority P1 10 3 P2 1 1 P3 2 3 P4 1 4 P5 5 2 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, i. A non preemptive priority (a smaller priority number implies a higher priority), and RR(quantum = 1) scheduling. b. What is the turnaround time of each process for each of the scheduling algorithms in part a ? c. What is the waiting time of each process for each of the scheduling algorithms in Part a? d. Which of the schedules in part a results in the minimal average waiting time (over all processes)?
4. 2. Consider the following snapshot of a system:
Process Allocation Max Available AB C D ABCD AB C D P0 0012 0012 15 2 0 P1 1000 1750 P2 1354 2356 P3 0632 0652 P4 0014 0656 Answer the following questions using the bankers algorithm: a. What is the content of the matrix Need? Is the system in a safe state? b. If a request from process P1 arrives for (0, 4, 2, 0), can the request be granted immediately?