The CCS Extension Mechanism
There is one more basic capability mechanism needed for the CCS implementation of the DCCS. This mechanism allows processes to set themselves up to create new capabilities that they can service. Such mechanisms differ widely on existing C-list systems. A workable mechanism is described. Another primitive capability is needed to start things off:
5. Server Capability
a. "Create requestor", requestor number; > ; requestor
b. "My requestor?"; capability> answer, requestor number;
c. "Wait"; > reason, requestor number, PD; request
Two capabilities were introduced above besides the server, the requestor and request capabilities. These capabilities will be described as the invocations on a server are described.
The first invocation creates and returns a requestor capability. The number that is passed is associated with the requestor. The requestor capability is the new capability being created. Any sort of invocation can be performed on a requestor. This is their whole reason for existence. A process with a server capability can make a requestor look like any kind of capability.
The "My requestor?" invocation can be used to determine if a capability is a requestor on the invoked server, it returns either:
"Yes", requestor number; or "No",0;
The last invocation "Wait"s until something that requires the server's attention happens. There are two important events that a service routine needs to be notified about. If the last capability to a requestor is overwritten so that the requestor cannot again be invoked until a new one is created, the "wait" returns:
"Deleted", requestor number, 0; Nil
The last two parameters, 0 and Nil, are just filler for the returned PD and request (see 5c). When a "wait" returns "Deleted", the service routine can recycle any resources being used to service the numbered requestor (e.g., the requestor number).
The most important event that causes a "wait" to return is when one of the requestors for the server is invoked. In this case the server returns:
"Invoked", requestor number, PD; request
The third parameter, labeled PD, stands for Parameter Descriptor. It describes the number of each kind of parameter passing each way during a requestor invocation. Specifically, it consists of four numbers: Data bits passed, capabilities passed, data bits requested, and capabilities requested.
The last parameter received, the request capability, is used by the serving process to retrieve the passed parameters and to return the requested parameters to the requesting process. Accordingly, it has the following invocations:
6. Request Capability
a. "Read parameters"; > {The passed parameters
b. "Return", {The return parameters}> ;
The "Return" invocation has the additional effect of restarting the requesting process.
One thing that should be noted about the server mechanism is that invocations on a server's requestors are queued until the server is "wait"ed upon. This is one reason that a request is given a separate capability. The serving process can, if it chooses, give the request to some other process for servicing, while it goes back and waits on its server for more requests. The corresponding situation in the outside bank window analogy would be the case where the teller gives the request to someone else for service so that the teller can return to waiting customers. The request capability points back to the requesting process so that the return can be properly effected.
A sample service, that of the well known semaphore [8] service routine keeps a table containing the semaphore values for each semaphore that it is servicing. It also keeps a list of queued requests that represent the processes that become hung in the semaphore by "P"ing the semaphore when it has a value less than or equal to zero. The invocations on a semaphore are:
7. Semaphore
a. "P"; > ;
b. "V"; > ;
A diagram and flow chart for the semaphore serving process is given in Figures 1. and 2. The flow charts are given include most of the basic capability invocations, but do not include detailed descriptions of table searches. The table structure for the semaphore service routine includes entries for each supported semaphore. Each entry contains the semaphore value and a link into a list of pointers to the requests hung in the semaphore (if any).
The most important feature of the server mechanism is that, by using it, the functioning of any capability can be emulated.
This property, similar to the insertion property discussed in [9], is the cornerstone of the DCCS. The basic idea of the emulation is to have the server "wait" for requests and pass them on to the capability being emulated. Such emulation of a single capability is flow charted in Figure 3. The emulation flow charted is an overview that doesn't handle all situations correctly. For example, a capability may not return to invocations in the same order that they are received. These situations also appear in the DCCS, so their handling will be discussed there rather than here. It is important to note that, except for delays due to processing and communication, the emulation done in the DCCS is exact.