Active resources are those which perform tasks on their own and thus can actively execute a task. This includes CPUs, hard disks, and network connections. As these resources always do some kind of job processing, we call them processing resources.
Passive resources on the other hand can be owned by a process or thread for a certain period of time. A resource has to be acquired to be accessed. Since passive resources can be limited, processes or threads might have to wait until a resource becomes available. Typical examples of passive resources are connection pools and thread pools.
The acquisition and the release of a passive resource has to be represented in the SEFFs, which describe the control flow of a component (see page ). If a component requires access to a limited resource, it first has to acquire it using the AcquireAction. After it has finished its operation, it has to release the resource using the ReleaseAction. The semantics of a passive resource with its AcquireActions and ReleaseActions is based on the semantics of semaphores.
Figure 3.29 shows a simple SEFF that uses a passive resource. First, the SEFF performs some initialising actions that are captured in the internal action initialise. Next, an acquire action is invoked to get a connection to the database. The capacity attribute of the DBConnectionPool indicates that there are 15 connections to the database. If no connection is available, the AcquireAction blocks the current thread until a database connection is returned to the pool. The DBConnection object is then passed by the AcquireAction action to the internal action readData, which reads some entries from the database. Finally, the ReleaseAction returns the connection object to the DBConnectionPool allowing other processes to use it.
Example 3.10 shows how a passive resource is used by a SEFF. The object received from the DBConnectionPool is passed from one action to another. Within the actions, the object can be used. So, a passive resource can be owned and used by a process or thread for a certain period. Opposed to that, active resources cannot be owned. A scheduler decides which thread or process will be handled next by a processing resource. The processing resource enables processes and threads to handle some of their workload.