OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
calls any particular service at a time to avoid problems with system calls that are not
thread-reentrant.
Jacket routines are provided for UNIX input and output system calls (documented in any
UNIX programmer’s manual) and the fork( ) and sigaction( ) system calls. Jackets are
not provided for any other UNIX system calls or for any of the C runtime library
services. See /usr/include/dce/cma_ux.h for the full list of jacket routines.
8.1.1.1 Input and Output Jacket Routines
Jacket routines are provided for routines that perform input and output operations.
Examples of these operations are as follows:
• Open or create files, pipe symbols, and sockets
• Send and receive messages on sockets
• Read and write files and pipe symbols
Jacket routines are provided for Input/Output services so that DCE Threads can
determine when to issue or block the service call based on the results of the select()
system call. For these UNIX services, DCE Threads can determine whether issuing the
system call causes the process to block. If the system call causes the process to block,
DCE Threads blocks only the calling thread and schedules another thread to run in its
place.
Periodically, DCE Threads checks whether the original calling thread can issue its
operation without blocking the process. When the thread runs without blocking the
process, that thread is placed back into the queue of ready threads and, at its turn, the
thread resumes execution and issues the system call. Therefore, the jacket routines
provide thread-synchronous I/O operations where otherwise the system calls block the
entire process.
8.1.1.2 The fork( ) Jacket Routine
Jackets are provided for the fork( ) system call. A specific thread environment must exist
in the forked process when it resumes (begins) execution. These jacket routines allow
code to be executed in the context of the new process before the user code resumes
execution in it.
8.1.1.3 The atfork( ) Routine
The atfork( ) routine allows an application or library to ensure predicted behavior when
the fork( ) routine is used in a multithreaded environment. Using the fork() routine from
a threaded application or from an application that uses threaded libraries can result in
8− 2 Tandem Computers Incorporated 124245