Skip to main content

Ability to Learn About Messages Queued for Input

A process should be able to learn of the status of the Nth logical message queued on a given input channel. It should at least be able to determine if it is available, whether or not it is complete, how long it is and what it contains.

This facility allows a program to make general preparations before accepting a message. It offers some escape from being put into the awkward position of having accepted input and not being able to dispose of it. If for example, it is known that processing the message will result in two more messages being sent, then it is advantageous to get guarantees that the output can be generated before the input is accepted.

Under circumstances in which one end of a channel is moved from one process to another, for example, moving a teletype connection between a user program and a debugging program, this ability to scan ahead in the input stream allows a process to check whether or not pending input is really meant for it. If it is, the input will then be accepted normally, otherwise, the end of the channel must be first moved to another receiving process.

Accepting input should be viewed as a grave responsibility, not to be undertaken unless there is reasonable assurance that the input can be processed. One of the first rules of asynchronous system design is to detect errors as soon as possible. If propagated, the tangled results may be hopeless to unravel.