home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / sharedmem / part01 / src / client8.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-17  |  382 b   |  20 lines

  1. /* client8.c - constantly write a variable to common memory (see server8.c) */
  2.  
  3. #include <sys/time.h>
  4. #include "cm.h"
  5.  
  6. cm_variable *variable;
  7. cm_value value = { "foo", 4, 4, 0};
  8.  
  9. main()
  10. {
  11.     if (0>cm_init("constant writer",0,0)) exit(-1);
  12.  
  13.     if (!(variable = cm_declare("variable",CM_ROLE_XWRITER))) exit(-1);
  14.  
  15.     while (1) {
  16.         cm_set_value(variable,&value);
  17.         cm_sync(CM_NO_WAIT);
  18.     }
  19. }
  20.