2 votes 2 votes In which of the following order indefinite blocking may occur if we add and remove process from the list associated with a semaphore. a)LIFO b)FIFO Operating System process-synchronization + – Himani Srivastava asked Oct 14, 2015 Himani Srivastava 3.9k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes Indefinite blocking may occur if we add and remove processes from the list associated with a semaphore in LIFO order. Rohan Ghosh answered Oct 14, 2015 Rohan Ghosh comment Share Follow See all 6 Comments See all 6 6 Comments reply Himani Srivastava commented Oct 14, 2015 reply Follow Share Can you plz explain it ? 0 votes 0 votes Rohan Ghosh commented Oct 14, 2015 i edited by Rohan Ghosh Nov 3, 2015 reply Follow Share In LIFO we use stack.Suppose some processes are added to the stack and the 1st one to get into the stack will be the last one to get back into the job.Now if p1 added 1st,then some processes are added after p1,some of them got removed and again some process get into the stack.If this situation continues then probably p1 won't get the chance to come out.every time processes get removed opportunity comes closer to p1..but again some processes are added in the queue.Thus p1 got struck in an indefinite blocking being not sure when all the processes added after p1 will get removed completely. 1 votes 1 votes Himani Srivastava commented Oct 14, 2015 reply Follow Share got it thanku :) 0 votes 0 votes resuscitate commented Nov 2, 2015 reply Follow Share bro LIFO is implemented by stack,not queue.queue implements FIFO.correct your xplanation.though answer is right..It should be LIFO. 1 votes 1 votes Rohan Ghosh commented Nov 3, 2015 reply Follow Share Yes yes...sorry big mistake :P 0 votes 0 votes asu commented Nov 8, 2015 reply Follow Share (associated with semaphore)-what it means can u plz explain 0 votes 0 votes Please log in or register to add a comment.