OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
3. The RPC thread returns to the canceled client application thread with one of the
following outcomes:
• If a cancel exception has not been taken, the RPC thread returns normal call
results (output arguments, return value, or both) with a pending cancel.
• If the remote procedure is using an exception handler, a cancel exception can
be handled. The procedure resumes, and the RPC thread returns normal call
results without pending any cancel.
• If the remote procedure failed to handle a raised cancel exception, the RPC
thread returns with the cancel exception still raised. This is returned as a fault.
• If the cancel-timeout period expires, the RPC thread returns either a cancel-
timeout exception or status code, depending on how the application sets up its
error handling. This is true for all cases where any abnormal termination is
returned.
14.1.3 Multithreaded RPC Applications
DCE RPC provides an environment for RPC applications that create multiple application
threads (multithreaded applications). The application threads of a multithreaded
application share a common address space and much of the common environment. If a
multithreaded application must be thread-safe (guarantee that multiple threads can
execute simultaneously and correctly), the application is responsible for its own
concurrency control. Concurrency control involves programming techniques such as
controlling access to code that can share a data structure or other resource to prevent
conflicting overlapping access by separate threads.
A multithreaded RPC application can have diverse activities going on simultaneously.
A multithreaded client can make concurrent remote procedure calls and a multithreaded
server can handle concurrent remote procedure calls. Using multiple threads allows an
RPC client or server to support local application threads that continue processing
independently of remote procedure calls. Also, multithreading enables the server
application thread and the client application threads of an RPC application to share a
single address space as a joint client/server instance. A multithreaded RPC application
can also create local application threads that are uninvolved in the RPC activity of the
application.
Figure 14-6 shows an address space where application threads are executing
concurrently.
The application threads in Figure 14-6 are performing the following activities:
• The server application thread is listening for calls.
• A call thread is available to execute an incoming remote procedure call.
• One client application thread has separated from an RPC thread and another is
currently part of an RPC thread.
• A local application thread is engaging in non-RPC activity.
14 − 6 Tandem Computers Incorporated 124245