Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  A system has n = 13 resources R0,…,R12... Start Learning for Free
A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:
if (i%2 == 0)
{
if (i < n) request Ri
if (i+2 < n) request Ri+2
}
else
{
if(i < n) request Rn - i
if (i+2 < n) request Rn-i-2
}
Minimum number of the process so deadlock is possible _________.
    Correct answer is '7'. Can you explain this answer?
    Most Upvoted Answer
    A system has n = 13 resources R0,…,R12, and k processes P0,&hel...
    As we know,
    n should be odd then deadlock will be possible if k should be = (n+2)/2.
    Now,
    n =13 then k will be floor (13+2)/2 = floor 15/2 = 7
    (n is taken as 13 because as mentioned in the question Resources are R0 to R12)
    So, n = 13 and k = 7 then deadlock is possible.
    Case I:
    Even processes request even resources and odd processes request odd resources. i.e.
    Even Processes:
    P0 requests R0 and R2
    P2 requests R2 and R4 and so on.
    Odd Processes:
    P1 requests R9 and R11
    P3 requests R7 and R9 and so on.
    So, there would not be any scenario of deadlock.
    Case II:
    All process request even resources:
    Even Processes:
    P0 requests R0 and R2
    P2 requests R2 and R4
    P4 requests R4 and R6
    P6 requests R6 and R8 (Deadlock arise)
    Odd Processes:
    P1 requests R12 and R10
    P3 requests R10 and R8
    P5 requests R8 and R6 (Deadlock arise)
    Hence, the correct answer is 7.
    Free Test
    Community Answer
    A system has n = 13 resources R0,…,R12, and k processes P0,&hel...
    Explanation:

    Resource Request Logic:
    - For even processes (Pi%2 == 0):
    - Request Ri and Ri+2 if i < n="" and="" i+2="" />< n="" />
    - For odd processes (Pi%2 != 0):
    - Request Rn-i and Rn-i-2 if i < n="" and="" i+2="" />< n="" />

    Analysis:
    - For deadlock to occur, each process must hold at least one resource and be waiting for another resource held by another process in a circular wait.
    - The even processes (P0, P2, P4, ...) request resources in a way that does not create a circular wait condition.
    - The odd processes (P1, P3, P5, ...) request resources in a way that creates a circular wait condition with the even processes.
    - For deadlock to occur, there must be at least 4 odd processes waiting for the same set of resources held by even processes.

    Minimum Number of Processes for Deadlock:
    - The first odd process (P1) requests Rn-1 and Rn-3.
    - The second odd process (P3) requests Rn-3 and Rn-5.
    - The third odd process (P5) requests Rn-5 and Rn-7.
    - The fourth odd process (P7) requests Rn-7 and Rn-9.
    - At this point, there are 4 odd processes waiting for the resources held by even processes, leading to a circular wait and deadlock possibility.
    - Therefore, the minimum number of processes for deadlock is 7.
    Explore Courses for Computer Science Engineering (CSE) exam

    Similar Computer Science Engineering (CSE) Doubts

    Top Courses for Computer Science Engineering (CSE)

    A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer?
    Question Description
    A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer?.
    Solutions for A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
    Here you can find the meaning of A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer?, a detailed solution for A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer? has been provided alongside types of A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice A system has n = 13 resources R0,…,R12, and k processes P0,…Pk−1. The implementation of the resource request logic of each process Pi is as follows:if (i%2 == 0){if (i < n) request Riif (i+2 < n) request Ri+2}else{if(i < n) request Rn - iif (i+2 < n) request Rn-i-2}Minimum number of the process so deadlock is possible _________.Correct answer is '7'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
    Explore Courses for Computer Science Engineering (CSE) exam

    Top Courses for Computer Science Engineering (CSE)

    Explore Courses
    Signup for Free!
    Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
    10M+ students study on EduRev