Open System Services Programmer's Guide

The functions listed above provide only basic $RECEIVE handling support, not higher-level
capabilities associated with a $RECEIVE package. You can build such higher-level functions using
the primitives present in the thread-aware $RECEIVE functions, but must tailor them for whatever
domain-specific application they occur in. High-level capabilities not supported by the thread-aware
$RECEIVE functions include:
Maintenance of an opener’s table
Pathway server semantics (exit upon last close)
Automatic resend of last replies for NonStop requesters
Distribution of messages based on type or opener
Any special handling of system messages (system messages are supported, but are treated
as any other message)
Encapsulation of the open or close of $RECEIVE, or any SETMODE
Table 71 Thread-Aware $RECEIVE Functions and Types
DescriptionFunction
Register filenum being managed by the $RECEIVE callbackput_INITRECEIVE()
Thread-aware function specifically for reading $RECEIVEput_RECEIVEREAD()
Thread-aware REPLYX()put_REPLYX()
Thread-aware READX()put_READX()
Using Thread-Aware $RECEIVE Functions
Example 99 through Example 101 show using thread-aware $RECEIVE functions.
Example 99 (page 415) shows the program flow for using a thread-aware $RECEIVE function.
Example 99 Thread-Aware $RECEIVE Program Flow
...
FILE_OPEN(, &filenum, , receive_depth, );
put_INITRECEIVE(filenum, receive_depth);
...
// Do work on filenum.
...
put_unregFile(filenum);
FILE_CLOSE(filenum);
...
Example 100 shows using the thread-aware functions put_RECEIVEREAD() and put_REPLYX()
to perform the actual work on $RECEIVE.
Reentrant OSS Functions 415