Service – Generic RPC Architecture

Generic code is available in the example and will work without modification for user specific functions. A decent amount of optimization is implemented using thread local storage for the interface. Conversion and mapping of address spaces between application-processes and the service-process as well as error handling also is included.
Parameters can be set at compile and/or runtime controlling:
  • SERVICE_NAME cataloged in root’s object directory
  • SERVICE_MBX cataloged in root’s object directory
  • worker_cnt number of dispatch threads working concurrently on service requests
  • worker_priority priority for servicing the request
  • worker_stack stack size created for the workers
  • sizeof(service_rqst)/sizeof(service_resp) size of parameters to user specific functions (default <=128)
This results in a pretty complex call structure with the benefit of clear isolation of user specific functions. Thus, implementation of user functions is straight forward.
 
User specific functions are isolated in two C-files (serviceifops.c, proxyops.c) along with two header files (service.h, serviceif.h). They need to be modified according to the functionality required. Look for “user defined” in the comments.
Examples are given for calls by value (func1) and calls by reference (func2, func3).