0 votes 0 votes https://gateoverflow.in/200133/os-ipc What is the correct answer? Operating System operating-system + – Swapnil Naik asked Nov 12, 2018 Swapnil Naik 333 views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Gurdeep Saini commented Nov 12, 2018 reply Follow Share B is the correct 0 votes 0 votes Hemanth_13 commented Nov 12, 2018 reply Follow Share @gurdeep Won't the processes contend for the shared resources?? If yes won't there be any possibility of deadlock 0 votes 0 votes Gurdeep Saini commented Nov 12, 2018 reply Follow Share @hemanth than it will depend on type of contend 0 votes 0 votes HeartBleed commented Nov 12, 2018 reply Follow Share In the question it is clearly mentioned that "a shared variable" and not "shared variables". When only one shared variable is there then there is no chance of deadlock. There are chances of inconsistencies, or data loss but not of deadlock. For deadlock to occur more than one resources or more than one instance of the same resource is required. 0 votes 0 votes Gurdeep Saini commented Nov 12, 2018 reply Follow Share HeartBleed consider this example lets we have to update the x than and two process A and B want to update the x entering condition for critical section for A is P(n)P(m) entering condition for critical section for B is P(m)P(n) here P means down and m and n have initial value 1,1 so now here is the chance of deadlock 0 votes 0 votes HeartBleed commented Nov 12, 2018 reply Follow Share Don't you think, if we apply that logic every system can be deadlocked. 0 votes 0 votes Gurdeep Saini commented Nov 12, 2018 reply Follow Share @heart bleed i have given you a example and we does apply this logic in real world problem because there is very large chance of deadlock so i have already said in the comment deadlock depend on the given condition but you are directly saying that there is no deadlock conclusion until the access condition is not given we can not say about deadlock 0 votes 0 votes HeartBleed commented Nov 12, 2018 reply Follow Share I'm stating my conclusion on the pretext that given question can solved using Precedence graph. In that case when you have one resource( in this case a single variable) and "n" processes trying to access that variable, the system allocates that one variable to anyone of that processes. In that case there may be starvation but not deadlock. 0 votes 0 votes Please log in or register to add a comment.