Skip to main content

3.3 Clean and Simple Interface

It is important, in this application, to develop the software in a modular way. It is desirable to put together a set of modules to carry out the different image processing tasks. Another set of transport modules must be developed for shipping data over the different networks to which the UCL system is attached. In our computerised facsimile system, these task modules are implemented as separate processes. The operation of the system relies on the communication between these processes. The interface which is used for such communication has been designed to be universal; it is independent of these modules, and has been termed the Clean and Simple interface [20]. This interface is discussed in this section.

3.3.1 Principles​

The Clean and Simple interface is concerned with the synchronisation and transfer of full-duplex data streams between two communicating processes. Thus the interface has three major components: connection synchronisation, data transfer and connection desynchronisation. These components are discussed below.

The connection between two processes is initiated by one of them, which, generally speaking, belongs to a higher layer. For example, the interface between protocols of different layers is always initiated by the higher layer, though, sometimes, the connection is initiated passively by the primitive 'listen'. It will be seen in the next section that task processes can communicate with each other via the connections to the higher layer (task controller) and this makes it possible to achieve flexible task organisation.

The process initiating the connection is called the 'master' process, while the other is called the 'slave' process. The 'master' process is also responsible for resource allocation for the two communicating processes. Here 'resource' refers mainly to the memory areas for the message structure and data buffer. This asymmetric definition of the interface eliminates any possible confusion in resource allocation.

The interface is implemented by using the signal-wait mechanism provided by the operating system. A data structure called CSB (Clean and Simple Block), which contains function, data buffer, and other information, is sent as the event message, when one process signals another [20].

3.3.2 Synchronisation and Desynchronisation​

The procedure for connection synchronisation is composed of two steps. First, the two processes exchange their identifiers for the specific connection by means of a getcid primitive. Usually, the pointer to the task control structure of the process is used as the connection identifier.

Then, the 'master' sends an open CSB with appropriate parameter string passing the initialisation information. This information, which can also be called open parameter, is process dependent, or more accurately, task dependent. For example, the parameters for the file system should be the file name and the access mode. Provided the 'slave' accepts the request, the connection is established successfully and data can be transferred via the interface.

In order to desynchronise the connection, the 'master' initiates a 'close' action. On the other hand, an error state or EOF (end of file) state can be reported by the 'slave' to request a connection desynchronisation.

The listen primitive in our system is reserved for the processes that receive a request from the remote hosts on the networks.

3.3.3 Data Transfer​

While the Clean and Simple interface is asymmetric in relation to connection synchronisation, data transfer is completely symmetric so long as the connection has been established. Data flows in both directions are permitted, though the operations are quite different.

The interface provides two primitives for data transfer -- read and write. To transfer some data to the 'slave', the 'master' signals it with a CSB containing the write function and a buffer filled with the data to be transferred. Having consumed the data, the 'slave' returns the CSB to report the result status of the transmission.

On the other hand, in order to receive some data from the 'slave', the 'master' uses a read CSB with an empty buffer. Having received the CSB, the 'slave' fills the buffer with the data requested and, then, returns the CSB.