Guardian Programmer's Guide

Table Of Contents
Introduction to Guardian Programming
Guardian Programmer’s Guide 421922-014
1 - 11
Advantages of the Requester/Server Model
The fact that the file system treats processes as files allows you to send user
messages to them as if writing to a file. Remember that processes read interprocess
messages by reading from a special input file opened with the name $RECEIVE. Each
process has its own $RECEIVE input file.
Much of this guide assumes a requester/server model. Section 6, Communicating
With Processes, discusses the techniques used for communication, including how to
send a message to another process and how to read messages from another process.
Section 21, Writing a Requester Program, and Section 22, Writing a Server Program,
provide detailed examples of requester and server processes incorporating many of
the features described in earlier sections.
Advantages of the Requester/Server Model
One of the advantages of the requester/server design is modularity. Once the
interfaces between the processes have been defined, each process can be developed
separately by its own development team. Modules developed this way are inherently
easier to maintain.
Requester/server applications are a convenient design model not only because of the
ease with which these applications can be developed and maintained but also
because:
You can easily add users to the application.
You can easily add new functions.
You can spread the load among multiple CPUs within a system.
You can improve the performance of an application that runs on several systems in
a network.
The following paragraphs discuss the above advantages of the requester/server
design.
Adding Users to the Application
When you need to add new users, all you need to do is replicate the requester
process. The server process is able to handle requests from several requesters.
Typically, the server handles one request at a time; when the server completes a
request, it waits for a request from some other requester. Alternatively, the server can
be designed to process requests concurrently.
Figure 1-2 shows several requesters accessing the same server.