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
Open System Services Porting Guide—520573-006
12-1
12 Porting Threaded Applications
This section summarizes the information you need to port existing threaded
applications from the previous standard (Draft 4) to Standard POSIX Threads. In
particular, this section summarizes considerations for porting HP NonStop Distributed
Computing Environment (DCE) Threads applications, and gives pointers to sources of
detailed information.
Standard POSIX Threads (T1248), a new product available in the G06.14 RVU,
adheres to IEEE POSIX Standard 1003.1c. The standard is officially designated as
International Standard ISO/IEC 9945-1; 1996 (E) IEEE Std 1003.1,1996 (Incorporating
ANSI/IEEE Stds 1003.1-1990, 1003.1b-1993, 1003.1c-1995, and 1003.1i-1995).
Change in Error Reporting
One significant global change you should make to existing threaded applications
involves error reporting. In the new standard, errors are not reported in errno but are
returned as a status or error value, such as EINVAL. The errors supported by Standard
POSIX Threads are described in the Standard document. Note that the error values
returned are in many cases the values that were previously stored in errno.
Considerations for Porting DCE Threads to
Standard POSIX Threads
To port existing applications that use DCE Threads (T8403) or DCE Threads on Java
(T5819) to Standard POSIX Threads, see the following sources of information:
•
Pthreads Programming, Bradford Nichols, Dick Buttlar, and Jacqueline Proulx
Farrell, O'Reilly & Associates, 1998, 270 pp.
See Appendix A, “Pthreads and DCE”, which describes these topics:
°
The Structure of a DCE Server
°
What Does the DCE Programmer Have to Do?
°
Example: The ATM as a DCE Server
•
Appendix E, Standard POSIX Threads Functions: Differences Between the
Previous and Current Standards.
See this appendix for a list of differences between the previous standard (Draft 4)
and IEEE POSIX Standard 1003.1c.