Question: What is the largest possible value of M so that the system is certain
ID: 3817949 • Letter: Q
Question
Question: What is the largest possible value of M so that the system is certain to be deadlock free? Explain?
Consider a system with 12 resources of the same type shared by 5 processes. Let M be the maximum number of resources that can be held by a process at one time (i.e., one is certain that a process will never try to acquire a resource if it already holds M of them).
Consider that each process runs the following pseudo-code:
while (true) {
for (int i=0; i < M; i++) {
acquire a resource;
}
Do some work
for (int i=0; i < M; i++) {
release a resource;
}
}
Explanation / Answer
For a system to be deadlock free, Sum of max resources needed by processes < No. of processes + No. of resources
5*M < 12+5
5*M <17
maximum value of M should be 3
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.