ResourcePool

This page contains an applet that should appear as a separate window.

This model illustrates resource management where a pool (containing only one resource) provides that resource nondeterministically to one of two Sleep actors. The Sleep actor that gets the resource holds it for a fixed amount of time (100 and 150 ms, respectively). After this time, it releases the resource, sending it to an Expression actor, which increments the value of the resource and then returns it to the resource pool.

Note that there is no assurance of fairness in this system, and in fact it is possible for only one of the two Sleep actors to get resources. How could you force this system to be more fair?

\ \ MoML specification for this model. \