Asynchronous RPC
Asynchronous RPC is a Microsoft extension that addresses several limitations of the traditional RPC model as defined by the Open Software Foundation-Distributed Computing Environment (OSF-DCE). By separating a remote procedure call from its return value, asynchronous RPC solves the following situations, which traditional RPC cannot handle:
-
Multiple outstanding calls from a single-threaded client. In the traditional RPC model, a client is blocked in a remote procedure call until the call returns. This prevents a client from having multiple outstanding calls, while still having its thread available to do other work.
-
Slow or delayed clients. A client that is slow to produce data may want to make a remote procedure with initial data and supply additional data as it is produced. This is not possible with conventional (synchronous) RPC.
-
Slow or delayed servers. A remote procedure call that takes a long time to complete will tie up the dispatch thread for the duration of the task. With asynchronous RPC, the server can start a separate (asynchronous) operation to process the request and send back the reply when it is available. The server can also send the reply in increments, as results become available, without having to tie up a dispatch thread for the duration of the remote call. By making the client application asynchronous, you can prevent a slow server from unnecessarily tying up a client application.
-
Transfer of large amounts of data. Transferring large amounts of data between the client and server, especially over slow links, ties up both the client thread and the server manager thread for the duration of the transfer. With asynchronous RPC and pipes, data transfer can take place incrementally, and without blocking the client or server from performing other tasks.
You take advantage of the asynchronous RPC mechanisms by declaring functions with the async attribute. Because you make this declaration in an application configuration (ACF) file, you do not have to make any changes to the IDL file, and asynchronous RPC has no effect on the wire protocol (how the data is transmitted between client and server). This means that asynchronous clients can communicate with an asynchronous server application, and synchronous clients can talk to an asynchronous server.
Asynchronous RPC is supported on Windows NT, effective with version 5.0.