Skip to main content

Process Synchronization

A major source of problems in many services involved synchronization of server; interacting over a relatively low-bandwidth, high-delay communications link.

Interactions in most services involve issuing a command and waiting for a response. The number of responses which can be elicited by a given command often varies, and there is usually no way to determine if all replies have arrived. Programs can easily issue a request before the responses to a previous request have completed, and get out of synchronization in a response is incorrectly matched to a request. Each server program must be meticulously designed to be capable of recovering if an unexpected reply arrives after a subsequent command is issued.

Note that, for reliable operation, it is always necessary that each response cause a reply to occur, at least in the sense that the request ts confirmed at some point. No service should perform a critical operation, such as deleting a file, which depends on the success of a previous request unless it has been confirmed. Requests in current protocols which do not appear to cause a reply may be viewed as confirmed later when a subsequent request is acknowledged, while such protocols work, they are more opaque than desirable, and consequently more difficult to implement.

These characteristics of protocols have often resulted in implementation of ad hoc methods for interaction, such as timeouts or sufficient length to assure correctness in an acceptably high percentage of situations. Often this has required careful tuning of programs as experience in using a protocol shows which commands are most likely to cause problems. Such methods generally result in a service which is less responsive, powerful, or efficient than desirable, and expensive to build and maintain.

Additionally, protocol specifications for services have often been incomplete, in that an enumeration of the responses which may occur for a given command is inaccurate or non-existent. This greatly complicates the task of the programmer trying to construct an intelligent server. In most cases, servers are slowly improved over time as experience shows which responses are common in each instance.

The synchronization problems mentioned above are in addition to those which naturally occur as part of the service operation. Thus, problems of synchronization may be split into two classes, those inherent in the service, and those associated with the interaction mechanism itself.

Construction of reliable, responsive servers can be assisted by careful design of the interaction mechanism and protocols. An unambiguous, completely specified mapping between commands and responses is desirable. Synchronization considerations of the two types can be attacked separately. An interaction mechanism which handles its own synchronization can be provided as a base for service' designers to use, relieving them of considerations of the low-level, protocol-derived problems, by providing primitives which encourage the design of reliable services.

To achieve a reasonable effective bandwidth, it is usually desirable to permit interacting programs to operate in a full-duplex fashion. Significant amounts of data are often in transit at any time. This magnifies the problems associated with interaction by introducing parallelism. The interaction mechanism can also be structured to provide ways of handling these problems, and to provide a basis on which servers which exploit parallelism can be constructed.

Many of these problems are too complex to warrant their consideration in any but the most active services. As a result, services are often constructed which avoid problems by inefficiencies in their operation, as mentioned above. Provision of an interaction mechanism and primitives for use by such services would promote efficiency interaction even by simple services which do not have the resources to consider all the problems in detail.