2. (24 points) Consider a system where there are 3 processes, A, B, and C. Their
ID: 3605898 • Letter: 2
Question
2. (24 points) Consider a system where there are 3 processes, A, B, and C. Their details are as follows: A: Arrival time = 0, CPU-I/O cycle = B: Arrival time = 2, CPU-I/O cycle = C: Arrival time = 4, CPU-I/O cycle = Assuming the access to I/O devices is concurrent: Show their execution under Round Robin (RR), time quantum = 2 Show their execution under SPN Show their execution under HRRN For each of these runs, identify waiting time for each process. (Recall waiting time = [time when process completes]-[time when process would have completed if there were no competing processes].) Make the following assumptions: 1. Regarding SPN, use the NEXT CPU time to decide the process to be selected. For example, if process A and B are considered to be executing and both are about to execute their first CPU cycle then the time for which they run is 6 and 3, respectively. 2. Regarding HRRN, use the 'total time waiting so far' and 'total service time' in computing HRRN. 3. Note that with round robin, even if the time quantum is 2, if the process starts I/O or finishes after 1 time unit then another process will start immediately.Explanation / Answer
No, its not possible
Let two process be P1, P2
Let three resources be R1, R2, R3
Case 1: P1 and P2 needs <=1 resources each.
no deadlock because we have 3 resources whereas we need max. 2 resources total
Case 2: P1 needs 1 and P2 needs 2 resources (or vice versa)
no deadlock since we have 3 resources and we need 3 resources.
Case 3: P1 and P2 both need 2 resources.
no deadlock again because we have 3 resources and we need max. 4 hence at a time only one process will be waiting for the resource to get free and when only one process is waiting then deadlock does not arise. (for a deadlock to happen at least 2 process should be waiting at the same time).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.