DCE Application Programming Guide

Application Programming With NonStop DCE
Threads
HP NonStop DCE Application Programming Guide429551-003
3-2
Threads Error Reporting
Threads Error Reporting
Like OSF DCE threads, the NonStop DCE threads API procedures can return error
indications in either of two ways:
Error status (using the errno variable)
With this method, the threads procedures return -1 to indicate an error condition
(instead of returning 0). The procedures set errno with the error status before
returning.
To use the error status method, a program must include the pthread.h
header file.
Exceptions
With this method, the threads functions report errors by raising an exception.
To use the exception method, a program must include the pthread_exc.h
header file.
All programs that use the NonStop DCE threads API must include either the
pthread.h header file or the pthread_exc.h header file, but not both. The threads
API procedure prototypes are the same in both files; the only difference is in how
failures are reported.
Signal Handling
Signal handling for NonStop DCE threads is the same as for OSF DCE threads:
Synchronous signals represent events that occur inside a process.
Synchronous signals occur immediately after the instruction that caused the
event—for example, attempting to divide by zero. A synchronous signal is
associated with the thread that is executing when the event occurs. A thread can
install signal handlers (using the sigaction() function) for the synchronous
signals that occur during its execution. For terminating signals, the default action is
to terminate the process.
Asynchronous signals represent events external to the process.
A thread can wait for a set of asynchronous signals using the sigwait() function.
If a thread is waiting for the type of signal that is received, the thread is awakened
SQL cursors Global
Environment variables Global
Signal mask Global
Table 3-1. Process Resource Types (page 2 of 2)
Resource Type Description