OSF DCE Application Development Guide--Introduction and Style Guide

Server Management
control, the server must provide a nondefault authorization function that gives the
machine principal access. An example of such an authorization function is given in
Chapter 3.
The server must register as a DCE server using the dce_server_register() call. This
call fulfills the majority of the server initialization tasks including creating bindings,
registering interfaces with the RPC runtime, registering endpoints with dced’s
endpoint mapper service, and advertising in the name service.
All servers should take these steps to operate correctly in DCE.
Finally, applications can provide application-specific server management. This would
typically be done for a persistant server that provides access to some shared resource
such as a database. Such a server can provide a set of privileged management
operations—such as database maintainance—as a seperate application-specific
management interface. Such an interface can be accessed by an application management
client that can also call the DCE management interfaces. This type of management
client is shown in the previous figure.
8.2 Manager Initialization
Server initialization tasks can typically be divided between essentially generic
initialization—creating bindings, establishing security state, exporting to a name service,
and listening for calls, among other things—and manager-specific initialization.
(Remember that management refers to a set of tasks to control a server while a manager
is a server’s implementation of a set of operations from one or more interfaces.)
Once the server has called rpc_server_listen( ), the manager operations may be called
asynchronously. The application may, however, need to perform some initialization
before any manager operations are performed. For example, the sample storage manager
(code example context_manager.c) needs to initialize its tables before any storage can
be allocated out of them. An application has three choices about manager initialization
policy:
1. The server can perform manager initialization before calling rpc_server_listen( ).
2. The server can have the first instance of a manager operation thread perform
manager initialization, using the pthread_once() facility. Although initilizing
everything prior to listening for remote procedure calls is more straight-forward
programming, some applications might benefit from this threaded approach. For
example, those operations that do not need the initialization could forgo use of the
pthread_once( ) facility. This is the approach demonstrated in the sample storage
manager.
124246 Tandem Computers Incorporated 83