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

Table Of Contents
OSS Porting Considerations
Open System Services Porting Guide520573-006
6-9
Using Signals
FIFO files cannot be created in the /G file system. However, Guardian processes can
access FIFOs using OSS API functions. Refer to the Open System Services
Programmers Guide for information on interoperability between Guardian and OSS
processes using OSS API functions.
Performance Considerations for Pipes and FIFOs
Similar to the operations of opening, reading, writing, and closing files and directories,
when you create pipes and FIFO files you use more system resources in the OSS
environment than in most standard UNIX environments. Most of these operations
involve the fork() function and the exec set of functions, which, as described in
Using Process-Creation Calls on page 6-13, involve the management of copies of data
in a multiple processor environment.
You can also increase performance by distributing processes across processors,
despite the extra overhead of dealing with pipes and FIFOs across processors. It all
depends on the type of applications that you are working with. When processes reside
within a single processor, there is no message system traffic. But when multiple
processors are used, a message system I/O path is created, which uses more system
resources.
Using Signals
OSS signal functions can be used with TNS/R and TNS/E native Guardian processes
but not with TNS processes. Refer to the Open System Services Programmer’s Guide
for more information.
Using Shared Memory
Shared memory, provided by the shmat(), shmctl(), shmdt(), and shmget()
function calls, is supported in the OSS environment. Shared memory segments enable
OSS processes to directly communicate with each other by sharing portions of each
others address space in a single processor. Shared memory does not simply provide
common access to data, it provides the fastest possible communication between
processes. With one memory write operation, a process can pass information to as
many processes as have the memory region shared.
A shared memory segment can be up to 128 megabytes in size. Memory segments
can be shared with a process’s child processes by offering communication through a
“thick pipe” between the parent and child process. Attached segments are propagated
during a fork() function and detached with the exec or tdm_spawn sets of
functions. Memory segments are not propagated to a child process after any of the
exec, tdm_exec, or tdm_spawn sets of functions, or when the child process resides
in a different processor from the parent.
If your programs use shared memory, use semaphores to synchronize access.
(Semaphore synchronization is done frequently in environments based on UNIX.)
Semaphores are described under Using Semaphores on page 6-10.