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

Table Of Contents
Open System Services Porting Guide520573-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.