home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_07 / 8n07102a < prev    next >
Text File  |  1990-06-19  |  1KB  |  27 lines

  1. /*
  2.  *       Note to the Editor:  this is Listing #2
  3.  */
  4.  
  5.  
  6. #define TRUE         1
  7. #define FALSE        0
  8. #define GLOB_NAME   "Common Window"  /* Parameters of global window   */
  9. #define GLOB_HEIGHT  6
  10. #define GLOB_WIDTH  80
  11. #define EPSILON ((double) 0.0000001) /* Smallest interval of interest  */
  12.  
  13. #define NUMPRC              4       /* Number of processes to simulate */
  14. #define MASTER      (2*NUMPRC)      /* "dummy node" claimed by master  */
  15. #define TERMINATE (2*NUMPRC+1)      /* "dummy node" waiting in main()  */
  16. #define NUM_MSGS  (2*NUMPRC+2)      /*  Total number of messages slots */
  17. #define REQ_DESQVIEW 0x201          /* Desqview 2.01 or later required */
  18.  
  19. typedef unsigned long DESQ_HAN;     /* Many DV functions use 32 bits   */
  20.  
  21. typedef struct monitor {
  22.    DESQ_HAN sem_han;                /* Mailbox belongs to the monitor  */
  23.    int sent[NUM_MSGS];              /* Count of messages pending       */
  24.    double value[NUM_MSGS];          /* Actual message data             */
  25.    } MONITOR;                       /* This is the keyword to use      */
  26.  
  27.