Open System Services Programmer's Guide
if (pthread_join(thread1, NULL) != 0)
{
perror("main: pthread_join");
exit(1);
}
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.
Jacket Routines (Nonblocking Versions of SERVERCLASS_ and TMF System
Calls)
A jacket routine invokes a nonblocking (nowait) version of the system call and suspends the thread
until the thread’s operation is complete. the PUT Model library provides jacket routines for
SERVERCLASS_SEND and SERVERCLASS_SENDL_ calls and for TMF transaction demarcation.
SERVERCLASS_SEND and SERVERCLASS_SENDL Jacket Routines
The PUT_SERVERCLASS_SEND_() function in the POSIX User Threads Model library sends a
message to and receives a reply from a server process in a Pathway server class. This jacket routine
invokes a nowait version of the system SERVERCLASS_SEND_ procedure. The thread that makes
the call is suspended until the send operation is complete.
The PUT_SERVERCLASS_SENDL_() functionalso sends a message to and receives a reply from
a server process in a Pathway server class. This jacket routine invokes a nowait version of the
system SERVERCLASS_SENDL_ procedure. The thread that makes the call is suspended until the
send operation is complete. This function allows for messages up to two megabytes long when
Expand-over-ServerNet is used. This function does not support using Expand-over-IP.
These functions can be used with the PUT_SERVERCLASS_SENDL_() function:
put_INITRECEIVEL()
put_RECEIVEREADL()
put_REPLYXL()
Another jacket routine, the PUT_SERVERCLASS_SEND_INFO_() function returns information
about the last PUT_SERVERCLASS_SEND_() or PUT_SERVERCLASS_SENDL_() call that was
attempted or completed by the current thread. The PUT_SERVERCLASS_SEND_INFO_() function
ensures that the thread gets the information for the last message sent by the thread rather than by
the process.
418 Using the POSIX User Thread (PUT) Model Library