Multithreading with Netbula RPC For Win32

Netbula RPC for Win32 supports multithreading, this document describe the procedure to build multithreaded (MT) RPC server and clients.

MT Server

There are two methods to create MT servers: thread on connect and thread on call.

Thread on connect

By calling pw_set_mt_on_connect(1) (with argument being 1) before svc{proto}_create(), the newly created service becomes a MT server.

Thread on call

The option will cause the server to create a new thread to handle an incoming RPC call, this option is applied to individual procedures.

MT Client

For ONC RPC, the return result from is stored in a static variable, to make this variable thread local, define the PWRPC_MT macro. One way to do this is to add a line

%define PWRPC_MT

in the *.x file.