figure 10.3. The next section provides a discussion of its principal dimensions.
10.5.1 Resource Kind
Control. The resource usually referred to in computer science as control is more accurately described as a thread of processor attention. In order for any software activity to begin execution, it needs to receive control from somewhere; that is, it needs to receive the attention of some processor. Control flow dependencies thus describe the flow of processor attention from one activity to another.
Data. Data resources include data values such as integers, strings, and arrays. They are further distinguished by their data type.
System. System resources represent various services offered by operating systems. They include passive resources such as shared memory pools, pipes, communication sockets, and active resources, such as name servers, and remote file transfer servers.
Hardware. Hardware resources correspond to hardware devices, such as printers, disk and tape drives, and multimedia adapters.
10.5.2 Resource Access
Resource access determines how producers and users access their corresponding resources.
Direct access resources. Control and simple data resources are communicated directly from producer to users. In a sense they are their own identifiers.
Indirect (named) access resources. Indirect access resources are accessed using a secondary data resource called the resource name or identifier. Flows of indirect access resources involve the communication of identifiers, rather than the resources themselves.
The use of identifiers is extremely widespread in software systems. Identifiers provide mappings that allow a wide variety of resources (system, hardware, complex data structures) to be accessed by software components that can only interface with their environment through relatively simple data resource ports.System and hardware resources are always accessed indirectly. Complex data resources, such as files and databases, are also typically accessed using identifiers.
10.5.3 Resource Transportability
Transportability determines whether resources can be moved around in the system.
Fixed resources cannot be moved. They have a fixed location in the system, and in order to be used, software activities have to be located ''close''to them. Hardware resources, such as printers, are examples of fixed resources.
Movable resources can be made accessible to other activities by transporting them to other locations in the system. Transportation of a movable resource usually involves an additional auxiliary resource called the carrier resource. Data resources are usually movable. For example, a data structure can be moved from one process to another by converting it into a byte stream and transmitting it through a pipe. The pipe (classified as a system resource) acts as the carrier resource in this case.
Resource | Usage | Description |
---|---|---|
Divisible | ||
Memory heap | Read/write | Heaps can be divided into independent smaller blocks |
Network channel | Connect | Physical network channels can support multiple independent connections |
Indivisible | ||
Scalar variable | Read/write | Scalar variables can only store one value |
pgp Encrypted file | Decrypt | Encrypted files can only be decrypted in their entirety |
10.5.4 Resource Sharing
This section describes a framework for reasoning about shared resources that was developed by George Wyner and Gilad Zlotkin (1995a) at the MIT Center for Coordination Science.Wyner and Zlotkin proposed a small number of important resource attributes that can help designers classify coordination requirements for shared resource dependencies. They observed that these important attributes are not merely a function of the resource type but of the intended mode of usage as well. That is, the same resource type used in different modes (e.g., read vs. written) might display different sharing behavior along those attributes. For that reason they refer to them as attributes of resources-in-use. These attributes are divisibility, consumability, and concurrency.Divisibility Divisibility specifies whether a resource-in-use can be divided into independent subresources. Some examples of divisible and indivisible resources are shown in table 10.1.Consumability Consumability specifies whether a resource-in-use is being destructively consumed. Consumable resources can be used a finite amount of times. Nonconsumable resources can be used an arbitrarily large amount of times. Some examples of consumable and nonconsumable resources in use are shown in table 10.2.
Concurrency Concurrency specifies whether a resource-in-use can be used by more than one users at the same time. Concurrency can be finite, setting a finite limit on the number of concurrent users, or infinite (arbitrarily large). Shown in table 10.3 are examples of finitely and infinitely concurrent resources.
Resource | Usage | Description |
---|---|---|
Consumable | ||
Pipe channel | Read | Values ''disappear''from the channel as they are being read |
PROM | Write | PROMs (programmable read only memories) can only be written once |
Nonconsumable | ||
File | Read | Files can be read an arbitrarily large amount of times |
Processor | Start task | Processors can be used to start an arbitrarily large number of tasks |
Resource | Usage | Description |
---|---|---|
Infinitely concurrent | ||
File | Read | In most systems multiple users are allowed to read files concurrently |
Multitasking processor | Start task | Multitasking systems appear to execute multiple tasks concurrently |
Finitely concurrent | ||
Ftp server | Connect | Ftp servers often limit the number of concurrent connections for performance reasons |
Printer | Print file | Printers cannot interleave the printing of different files |