OSF DCE Application Development Guide--Core Components
RPC and Other DCE Components
incoming calls avoids remote procedure calls failing during short-term congestion. The
queue capacity for incoming calls is implementation dependent; most implementations
offer a small queue capacity. The queuing of incoming calls is discussed in Chapter 16,
under the topic of the routing of incoming calls.
14.1.2 Cancels
DCE RPC uses and supports the synchronous cancel capability provided by POSIX
threads (pthreads). A cancel is a mechanism by which a thread informs another thread
(the canceled thread) to terminate as soon as possible. Cancels operate on the RPC
thread exactly as they would on a local thread, except for an application-specified,
cancel-timeout period. A cancel-timeout period is an optional value that limits the
amount of time the canceled RPC thread has before it releases control.
During a remote procedure call, if its thread is canceled and the cancel-timeout period
expires before the call returns, the calling thread regains control and the call is orphaned
at the server. An orphaned call may continue to execute in the call thread. However, the
call thread is no longer part of the RPC thread, and the orphaned call is unable to return
results to the client.
A client application thread can cancel any other client application thread in the same
process (it is possible, but unlikely, for a thread to cancel itself.) While executing as part
of an RPC thread, a call thread can be canceled only by a client application thread.
A cancel goes through several phases. Figure 14-5 shows where each of these phases
occur.
Figure 14-5. Phases of a Cancel in an RPC Thread
application
thread
Server
Client
Client
Call thread
RPC thread
RPC thread
Called
remote
procedure
Calling
code
3
1
2
The phases of a cancel in the preceding figure include the following:
1. A cancel that becomes pending at the client application thread at the start of or
during a remote procedure call becomes pending for the entire RPC thread. Thus,
while still part of the RPC thread, the call thread also has this cancel pending.
2. If the call thread of an RPC thread makes a cancelable call when cancels are not
deferred and a cancel is pending, the cancel exception is raised.
124245 Tandem Computers Incorporated 14−5