OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
client uses this information to establish a relationship, known as a binding, with the
server.
14.1 Threads of Execution in RPC Applications
Each remote procedure call occurs in an execution context called a thread. A thread is a
single sequential flow of control with one point of execution on a single processor at any
instant. A thread created and managed by application code is an application thread.
Traditional processing occurs exclusively within local application threads. Local
application threads execute within the confines of one address space on a local system
and pass control exclusively among local code segments, as illustrated in Figure 14-1.
Figure 14-1. Local Application Thread During a Procedure Call
Traditional application
Called
procedure
Calling
code
local application thread
Single address space
RPC applications also use application threads to issue both remote procedure calls and
runtime calls, as follows:
• An RPC client contains one or more client application threads; that is, a thread that
executes client application code that makes one or more remote procedure calls.
• A DCE RPC server uses one server application thread to execute the server
application code that listens for incoming calls.
In addition, for executing called remote procedures, an RPC server uses one or more call
threads that the RPC runtime provides. As part of initiating listening, the server
application thread specifies the maximum number of concurrent calls it will execute. The
maximum number of call threads in multithreaded applications depends on the design of
the application. The RPC runtime creates the same number of call threads in the server
process.
The number of call threads is significant to application code. When using only one call
execution thread, application code does not have to protect itself against concurrent
resource use. When using more than one call thread, application code must protect itself
against concurrent resource use.
Figure 14-2 shows a multithreaded server with a maximum of four concurrently
executing calls. Of the four call threads for the server, only one is currently in use; the
other three threads are available for executing calls.
14 − 2 Tandem Computers Incorporated 124245