Open System Services Programmer's Guide
if (pthread_join(thread2, NULL) != 0)
{
perror("main: pthread_join");
exit(1);
}
}
Caveats to Using Thread-Aware $RECEIVE
Proper operation of thread-aware $RECEIVE depends on the following conditions:
• No calls to AWAITIO[X] () with a file number of -1 are made.
• No calls to AWAITIO[X] () with a file number for $RECEIVE are made.
• No calls to FILE_COMPLETE_SET_ () are made.
• No calls to FILE_COMPLETE_ () are made using the permanent set.
Thread-Aware Enscribe Functions
Thread-aware Enscribe functions are supported on J-series RVUs, H06.05 and later H-series RVUs,
and G06.28 and later G-series RVUs. Thread-aware Enscribe functions (Table 63 (page 376))
provide thread aware wrappers for Enscribe procedure calls that enable an application to make
use of Enscribe procedure calls without blocking the process.
Thread-aware Enscribe functions are thread-blocking, like functions in the thread-aware library,
instead of process-blocking, like other Enscribe functions.
The parameters and the semantics for the new APIs are the same as those of Enscribe procedures,
which are described in the Guardian Procedure Calls Reference Manual.
The thread-aware APIs for Enscribe procedure calls can:
• Open a file
• Read and write
• Cancel I/O operations issued on the file
• Lock and unlock the file or a record
• Execute device-dependent operations on an open file
• Set device-dependent functions in an open file
These functions must be explicitly called. There are no macros to map to these functions from the
non-thread aware versions.
Table 63 Thread-Aware Enscribe Functions
DescriptionFunction
Cancels the oldest incomplete operation on a file opened nowaitedSPT_CANCEL
Performs device-dependent I/O operationsSPT_CONTROL
Closes an open fileSPT_FILE_CLOSE_
Establishes a communication path between an application process and a fileSPT_FILE_OPEN_
Returns data from an open file to the application process data areaSPT_READX
Reads data from a disk or process file in anticipation of a subsequent write to the
file
SPT_READUPDATEX
Sequentially locks and reads records in a disk fileSPT_READLOCKX
Locks, then reads the record from the current position in the file in anticipation of
a subsequent call to SPT_WRITEUPDATEX or SPT_WRITEUPDATEUNLOCKX
SPT_READUPDATELOCKX
376 Using the Standard POSIX Threads Library