/* Giorgio Ingargiola (June 99) This directory shows an example of RPC use, where each RPC call is executed by a different thread in the server. We show the use of locks to protect data shared by the remote procedures. The remote procedure are add and subtract, that return respectively the sum and the difference of two integers. On the server we assume that there is a shared integer, total, in which we store the sum of the results of all the calls. This shared variable is protected by a lock. To make it easier to have contention between calls of concurrent clients, we have inserted a sleep period of two seconds during the execution of the remote procedures. FILES Makefile The name says it all TAGS File created by the command etag -t *.[ch] to allow me, when using emacs to get to the definition of symbols with ESC-. mc.x XDR definition of the remote procedure interface. Written by developer. It is used with the command rpcgen mc.x to generate the files mc.h, mc_sdr.c, mc_svc.c [which we modify to mc3_svc.c], mc_clnt.c mc.h Generated by rpcgen, c interface to remote procedures mc_xdr.c Generated by rpcgen, functions to convert to/from xdr, i.e. worry about data representation mc_clnt.c Generated by rpcgen, the client stub of the remote procedures mc3_svc.c Modification done by developer of the file mc_svc.c generated by rpcgen - the skeleton on the server. mc3_svc_proc.c Written by developer, the implementation of the remote procedures on the server. mc.c Writen by the developer, the main function of the client. It calls the remote procedures */