Question: Question Number 4 [4+4): a) Consider a scenario in which two processes (P1 and P2) send request to acquire a resource. The resource can be

 Question Number 4 [4+4): a) Consider a scenario in which two

Question Number 4 [4+4): a) Consider a scenario in which two processes (P1 and P2) send request to acquire a resource. The resource can be shared between the two processes in such a way that if Pl's request succeeds then P2 has to wait. Similarly, If P2's request succeeds then P1 has to wait. The Petri-Net model of the scenario is shown in the following figure. The sharing process can be synchronized in two different ways i.e., NON-DETERMINISTIC (any one process either P1 or P2 can access the resource at a time) and ALTERNATE (resource share one by one). You have to write initial and subsequent marking with comments for both the resource sharing conditions i.e., NON-DETERMINISTIC and ALTERNATE. [Note: For NON-DETERMINISTIC condition the following model can be used. However, for ALTERNATE resource sharing the following model need to be changed by introducing one additional place. Therefore, before writing the initial and subsequent marking for ALTERNATE resource sharing condition you have to sketch a new petri-net model]. - Preq P-reg -start 1-start 2 1-release I-release b) Readers And Writers models a scenario where several processes write shared data and several processes read shared data. The synchronization problem requires that no two writers write the data simultaneously and that no reader reads the data while it is being written. Use Petri Net to model this synchronization problem. Page 5 of 8 Question Number 4 [4+4): a) Consider a scenario in which two processes (P1 and P2) send request to acquire a resource. The resource can be shared between the two processes in such a way that if Pl's request succeeds then P2 has to wait. Similarly, If P2's request succeeds then P1 has to wait. The Petri-Net model of the scenario is shown in the following figure. The sharing process can be synchronized in two different ways i.e., NON-DETERMINISTIC (any one process either P1 or P2 can access the resource at a time) and ALTERNATE (resource share one by one). You have to write initial and subsequent marking with comments for both the resource sharing conditions i.e., NON-DETERMINISTIC and ALTERNATE. [Note: For NON-DETERMINISTIC condition the following model can be used. However, for ALTERNATE resource sharing the following model need to be changed by introducing one additional place. Therefore, before writing the initial and subsequent marking for ALTERNATE resource sharing condition you have to sketch a new petri-net model]. - Preq P-reg -start 1-start 2 1-release I-release b) Readers And Writers models a scenario where several processes write shared data and several processes read shared data. The synchronization problem requires that no two writers write the data simultaneously and that no reader reads the data while it is being written. Use Petri Net to model this synchronization problem. Page 5 of 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!