Open System Services Programmer's Guide
This type of application includes OSS servers that maintain application state in the server to improve
performance or that share resources, such as file opens, to reduce resource consumption. This type
of application also includes client programs that use parallelism.
Programs with multiple interdependent application threads can be synchronized by using mutexes
to reserve access to a shared resource and by using condition variables to wait for a shared
resource to be in a certain state.
Poor performance can result if inappropriate synchronization techniques are used. Synchronizing
at too coarse a level can overly restrict concurrency and cause a server to serialize processing,
dramatically increasing the application’s service time. Synchronizing at too fine a level can result
in an increase in the processor cycles spent on initializing, obtaining, and releasing mutexes and
dispatching threads.
Jacket Routines
A jacket routine invokes a nonblocking (nowait) version of the system call and suspends the thread
until the thread’s operation is complete. Standard POSIX Threads provides jacket routines for
SERVERCLASS_SEND and SEVERCLASS_SENDL_ calls and for TMF transaction demarcation.
Full reference and syntax information for the jacket routines is available online in the OSS
environment using the man command.
SERVERCLASS_SEND and SERVERCLASS_SENDL Jacket Routines
The SPT_SERVERCLASS_SEND_() function in the threads 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 SPT_SERVERCLASS_SENDL_() function, which is supported on J06.07 and later J-series
RVUs and H06.18 and later H-series RVUs only, also 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 SPT_SERVERCLASS_SENDL_() function:
spt_INITRECEIVEL()
spt_RECEIVEREADL()
spt_REPLYXL()
Another jacket routine, the SPT_SERVERCLASS_SEND_INFO_() function returns information
about the last SPT_SERVERCLASS_SEND_() or SPT_SERVERCLASS_SENDL_() call that was
attempted or completed by the current thread. The SPT_SERVERCLASS_SEND_INFO_() function
ensures that the thread gets the information for the last message sent by the thread rather than by
the process.
The SERVERCLASS_SENDL_ jacket routines (SPT_SERVERCLASS_SENDL(),
spt_INITRECEIVEL(), spt_RECEIVEREADL(), and spt_REPLYXL()) are included in the
Standard POSIX Threads library on J06.07 and later J-series RVUs and H06.18 and later H-series
RVUs only:
c89 -o program program.o -lzsptdll
The SERVERCLASS_SEND_ jacket routines are included in the Standard POSIX Threads library that
can be bound to an application requiring them:
c89 -o program program.o -lzsptsrl (TNS/R programs)
c89 -o program program.o -lzsptdll (TNS/E programs)
Jacket Routines 333