Open System Services Porting Guide (G06.24+, H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to Porting
- 2 The Development Environment
- 3 Useful Porting Tools
- 4 Interoperating Between User Environments
- Purpose of Interoperability
- The OSS User Environment
- OSS Commands for the Guardian User
- Guardian Commands for the UNIX User
- OSS Pathname and Guardian Filename Conversions
- Running the OSS Shell and Commands From TACL
- Running Guardian Commands From the OSS Shell
- Running OSS Processes With Guardian Attributes
- Using OSS Commands to Manage Guardian Objects
- 5 Interoperating Between Programming Environments
- 6 OSS Porting Considerations
- 7 Porting UNIX Applications to the OSS Environment
- 8 Migrating Guardian Applications to the OSS Environment
- General Migration Guidelines
- C Compiler Issues for Guardian Programs
- Using New and Extended Guardian Procedures
- Using OSS Functions in a Guardian Program
- Interoperating With OSS Programs
- Starting an OSS Program From the Guardian Environment
- C Compiler Considerations for OSS Programs
- Porting a Guardian Program to the OSS Environment
- How Arguments Are Passed to the C or C++ Program
- Differences in the Two Run-Time Environments
- Which Run-Time Routines Are Available
- Use of Common Run-Time Environment (CRE) Functions
- Replacing Guardian Procedure Calls With Equivalent OSS Functions
- Which IPC Mechanisms Can Be Used
- Interactions Between Guardian and OSS Functions
- 9 Porting From Specific UNIX Systems
- 10 Native Migration Overview
- 11 Porting or Migrating Sockets Applications
- 12 Porting Threaded Applications
- A Equivalent OSS and UNIX Commands for Guardian Users
- B Equivalent Guardian Commands for OSS and UNIX Users
- C Equivalent Inspect Debugging Commands for dbx Commands
- D Equivalent Native Inspect Debugging Commands for dbx Commands
- E Standard POSIX Threads Functions: Differences Between the Previous and Current Standards
- Glossary
- Index
OSS Porting Considerations
Open System Services Porting Guide—520573-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
Programmer’s 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
other’s 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.