Download presentation
Presentation is loading. Please wait.
1
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 1 The act of waiting for a resource is represented by pWait. The act of using a resource is represented by pR1 and pR3 for resources R1 & R3 respectively R1 and R3 are locked (i.e. unavailable) when pMutexR1 and pMutexR3, respectively, have no more tokens. Note that pMutexR1 can hold 1 token representing the fact that R1 can have one concurrent use. Note that pMutexR3 can hold 3 tokens representing the fact that R3 can have 3 concurrent uses. In this state TgetR1 and TreleaseR3 are enabled and any token in pWait may move to either pR1 or pR3.
2
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 2 In this state, pR1 is in use and must be released before anyone in pWait can use it. R3 is available for use. pWait has one less token. This token was used to transition to pR1.
3
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 3 In this state, TgetR3 has fired and one usage of R3 is in progress. Note that TgetR3 is still enabled as there are still tokens in pMutexR3 and in pWait.
4
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 4 In this state, TgetR3 has fired again and R3 has 2 concurrent uses. pMutexR3 is down to just 1 token.
5
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 5 In this state, R3 has 3 concurrent uses. TgetR3 is no longer enabled as pMutexR3 has no more tokens. This matches the requirement. At this point all resources are being used. A resource must be released before either Tget is fired.
6
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 6 In this state, TreleaseR1 has fired, replacing the token in pMutexR1 and returning a token to pWait. Note that this has re-enabled TgetR1.
7
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 7 In this state, TreleaseR3 has fired returning one token to pMutexR3. TgetR3 is enabled as pMutexR3 and pWait both have at least one token. R3 now only has 2 concurrent uses.
8
TgetR1 TreleaseR1 TreleaseR3 TgetR3 pWait pMutexR3 pR3 pMutexR1 pR1 State 8 In this state, TreleaseR3 has fired again replacing another token in pMutexR3 and in pWait. R3 has one concurrent use. Note that these Petri Net state diagrams are a representation of most of the possible states that the net can be in, but are not necessarily in the order in which the system would operate. For example, there is no reason why R1 could not be acquired and released multiple times before R3 was even used.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.