TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Designing Your Application
NonStop TS/MP Pathsend and Server Programming Manual–132500
2-20
Design Considerations
After you code and compile your server program, the server object code and library code
are shared among all processes of the same server class.
Design Considerations
Before structuring and coding a server program, you should consider some design issues
that can affect server performance and efficiency. First, you must decide whether to
program single-threaded or multithreaded servers. Additionally, you should be aware of
the issues related to context-free versus context-sensitive servers, server packaging,
nested servers, aborting transactions, process pairs, early replies, and audited and
unaudited servers. You might also consider the use of a GDSX back-end process.
Single-Threaded Versus Multithreaded Servers
When writing Pathway server programs, you need to consider whether to write them as
single-threaded or multithreaded programs.
Typically, you can get solid performance from single-threaded servers, which are
simpler to design, program, and maintain than multithreaded server programs. For most
applications, single-threaded server design is recommended.
Single-threaded servers generally perform well because they are highly utilized. Server
processes handle requests from many requester programs (for example, a few servers
might support 100 terminals), keeping the server processes highly utilized. Servers are
not idle waiting for input from a single requester or device; they can get work from any
requester or device.
Low server utilization, however, might still result if the server experiences long waits
while processing a request. The main reason for writing multithreaded servers is to
provide resource efficiency in applications where processes have long waits (for
example, when a server creates Guardian processes on demand or communicates with a
remote system from another vendor) or shared access (for example, when requests are
multiplexed over a single link).
Context-Free Servers Versus Context-Sensitive Servers
If your servers are programmed to be context-free, the relationship between an
application requester program (for example, a SCREEN COBOL program) and a
Pathway server process exists only for the duration of a single send operation: that is,
one request message and the server’s reply to it. Subsequent send operations to the same
server class could be serviced by any server process in the server class.
This design allows server processes to be easily shared and serially reused by many
requesters. The sharing and reusing of server processes results in more highly utilized
servers and consequently can require fewer server processes, depending on the service
time required. The assignment of requests to server processes on a per-request basis also
allows the PATHMON process to improve the distribution of work among the available
servers.
However, context-free design requires that your servers not save any information (that is,
context) from previous requests, such as counts, subscripts, or record pointers.
Transaction context must be maintained outside of the server, either by the requester