Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
OSS Porting Considerations
Open System Services Porting Guide520573-006
6-8
Using Pipes and FIFO Files
Using a Pipe Across Processors
In the OSS environment, there is one OSS pipe server for each processor. The OSS
pipe server process is started at reload time and handles all pipe-creation tasks per
processor; it is the destination for all cross-processor pipe and FIFO I/O traffic. When
you create a pipe across processors, you have to communicate with the OSS pipe
server in the processor that owns that pipe. This interaction involves copying
information between pipe buffers across processors, thereby using more system
resources.
If the child process is created in another processor, all pipe I/O by the child processes
is handled by the processor in which the parent process is running. This strategy
requires interprocessor traffic and incurs more system overhead than when the parent
and child processes are running in the same processor.
Despite the steps involved, using multiple processors has performance advantages
such as load balancing. If your code uses a lot of pipes between processors, be aware
of the additional system overhead.
Opening and Reading a FIFO File
Reading a FIFO file in the OSS environment also involves more system resources
when done across processors. Reading a FIFO is the same operation as reading a
pipe—the only difference being that a FIFO has a name in the OSS file system.
When you open a FIFO file, the OSS name server resolves the pathname for your
OSS file open request. When you open and read a FIFO across processors, there is
more communication added by the interaction between OSS pipe servers.
The following are the steps for opening a FIFO:
1. An application (client) uses a file open call for a FIFO called afifo. The open()
function sends a file open request to the OSS name server.
2. The OSS name server resolves the pathname and determines that it refers to a
FIFO that is not currently open.
3. The OSS name server picks an OSS pipe server and stores the processor number
of the OSS pipe server for the local opener.
4. The OSS name server sends a FIFO open request to the OSS pipe server.
5. The OSS pipe server creates a FIFO.
6. The OSS pipe server returns the FIFO’s ID to the OSS name server.
7. The OSS name server replies to the application with the FIFO’s ID. (The returned
FIFO ID has encoded within it the processor number of the OSS pipe server
handling this FIFO—see Step 3.)
Despite the overhead associated with dealing with pipes and FIFOs across processors,
there are often good reasons to distribute the processes across processors to improve
the overall performance and throughput of the application.