Q34
MCQ2 marks, −0.67Operating systemsMediumA shared variable , initialized to zero, is operated on by four concurrent processes as follows. Each of the processes and reads from memory, increments by one, stores it to memory, and then terminates. Each of the processes and reads from memory, decrements by two, stores it to memory, and then terminates. Each process before reading invokes the operation (i.e., wait) on a counting semaphore and invokes the operation (i.e., signal) on the semaphore after storing to memory. Semaphore is initialized to two. What is the maximum possible value of after all processes complete execution?
Keys: A–D or 1–4 choose, Enter checks, ← → move between questions.
Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.