Open System Services Programmer's Guide

Using Thread-Aware $RECEIVE Functions............................................................................373
Caveats to Using Thread-Aware $RECEIVE..........................................................................376
Thread-Aware Enscribe Functions............................................................................................376
Using Thread-Aware Enscribe Functions..............................................................................377
OSS File Descriptor and Timer Callbacks.................................................................................379
Using OSS and Timer Callbacks........................................................................................379
Caveat to Using Callbacks................................................................................................379
13 Using the POSIX User Thread (PUT) Model Library ....................................380
Compiling and Linking Considerations.....................................................................................380
Header Files....................................................................................................................380
Linking to the POSIX User Thread Model Library...................................................................380
Defines...........................................................................................................................380
Environment Variables......................................................................................................381
Standards Conformance........................................................................................................381
Error Reporting Changed From Draft 4 Standard..................................................................381
Exceptions and Extensions to the Standard Document...........................................................381
Attributes Defined by Threads Macros ....................................................................................382
Process Resources.................................................................................................................383
Numerical Limits in the POSIX User Thread Model Library..........................................................383
Protected Stack Limits........................................................................................................383
Limits Imposed by the Standard..........................................................................................383
Signals and Signal Handling.................................................................................................385
Types of Signals...............................................................................................................385
Using Signals..................................................................................................................386
Thread-Aware Signal Handling..........................................................................................388
Thread-Aware and Nonblocking OSS Functions........................................................................396
Regular Files...................................................................................................................396
Non-Regular Files............................................................................................................397
Equivalent System, Thread-Aware, and Nonblocking Thread-Aware Functions...........................397
The Set of Thread-Aware I/O Functions Must Be Used Together..............................................399
Using Thread-Aware Functions...........................................................................................399
Threads Portability................................................................................................................406
Thread Safety.......................................................................................................................406
Functions That Are Not Thread Safe....................................................................................406
Cancellation Points...........................................................................................................407
Potential Cancellation Points..............................................................................................407
Reentrant OSS Functions........................................................................................................408
Example Program Using Reentrant Functions........................................................................409
Thread-Aware Toolkit Functions and Types...........................................................................410
Using Thread-Aware Toolkit Functions.................................................................................411
Caveats to Using the Thread-Aware Toolkit .........................................................................414
Thread-Aware $RECEIVE I/O Functions...............................................................................414
Using Thread-Aware $RECEIVE Functions............................................................................415
Caveats to Using Thread-Aware $RECEIVE..........................................................................418
Jacket Routines (Nonblocking Versions of SERVERCLASS_ and TMF System Calls)..........................418
SERVERCLASS_SEND and SERVERCLASS_SENDL Jacket Routines...........................................418
SERVERCLASS_DIALOG Jacket Routines..............................................................................419
TMF Transaction Jacket Routines.........................................................................................419
Thread-Aware Enscribe Functions............................................................................................420
Using Thread-Aware Enscribe Functions..............................................................................421
OSS File Descriptor and Timer Callbacks.................................................................................422
Using OSS and Timer Callbacks........................................................................................423
Caveat to Using Callbacks................................................................................................423
Converting Applications that use the SPT Library.......................................................................423
Contents 9