Question: Part B [ 1 2 marks ] : Sometimes it is necessary to synchronize two or more processes in a group so that every process
Part B marks: Sometimes it is necessary to synchronize two or more processes in a group so that every process must finish its first phase of computation before any other process is allowed to start its second phase. This is called barrier synchronization; For example, for two processes Pl and P we can write:
Semaphores: sl s;
In this question, you are required to synchronize five processes P P P P and P The new rules are: Process P must finish both phase I and phase II before any of the other processes can access any of their phases, Process P must finish phase I next, followed by process P which must finish Phase I before both P and P can start their phase Is all phase Is must finish before any phase II starts, and all phase II's must proceed in the order that is P must finish Phase II before P and P must finish Phase II before P and finally P must finish Phase II before P You are allowed to use any number of semaphores; however, semaphores cannot be initialized with negative values. Initializing or setting any semaphore to a negative value will result in a total discard of the solution. Fill in the missing synchronization code below:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
