Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started