The variables process_arrived and process_left are shared among all processes and are initialized to zero. In a concurrent program all the three processes call the barrier function when they need to synchronize globally. Which one of the following rectifies the problem in the implementation?
A. Lines 6 to 10 are simply replaced by process_arrived
B. At the beginning of the barrier the first process to enter the barrier waits until process_arrived becomes zero before proceeding to execute P(S)
C. Context switch is disabled at the beginning of the barrier and re-enabled at the end
D. The variable process_left is made private instead of shared
Answer:A
The variables process_arrived and process_left are shared among all processes and are initialized to zero. In a concurrent program all the three processes call the barrier function when they need to synchronize globally. Which one of the following rectifies the problem in the implementation?
A. Lines 6 to 10 are simply replaced by process_arrived B. At the beginning of the barrier the first process to enter the barrier waits until process_arrived becomes zero before proceeding to execute P(S) C. Context switch is disabled at the beginning of the barrier and re-enabled at the end D. The variable process_left is made private instead of shared