Home
Next:1.3 Resource Sharing with
failure
Previous: 1.1 Model
of Resource Sharing with function
Consider the example of Resource Sharing that was presented in the
previous section. Processes can only acquire a unit of resource if
there is at least one available. The corresponding transition can only
take place if the other parts of the system, i.e., the other processes,
do not already control all resource units. It is natural to model this
as a functional transition, which is indeed how we presented it above.
The function allows a process to access the resource when the number of
other processes already using the resource is strictly less than the
total number of units of resource. Let us now look at how this same
system may be modelled without using functional transitions. One
possibility is to introduce an additional automaton, a resource pool
automaton, which counts the number of units of resource available at
any
moment. The action of a process in acquiring a resource could then be
represented as a synchronizing event requiring the cooperation of the
demanding process and the resource pool. A further synchronizing event
would be needed for a process to return resource to the resource pool.
Figure illustrates the Resource Sharing system modelled using an
additional ``resource pool'' automaton and synchronizing events.
Figure: Resource Sharing
Model without functions - Mutex2 -
 |
In this model, each process
wishing to acquire
a resource must synchronize its action (by means of the synchronizing
event
) with that of the resource pool
automaton. Likewise, when finished with a unit of the resource, its
return to the resource pool is governed by the synchronizing event
.
The textual .san files
describing this model are:
Where :
- N is the nomber of processes
- P is the number of resource.
Next: 1.3
Resource Sharing with failure
Previous: 1.1 Model
of Resource Sharing with function
Home