No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pc-header.h 789B

12345678910111213141516171819202122
  1. #ifndef __pc_header_h__
  2. #define __pc_header_h__
  3. #define MAX_THREADS (100) // maximum number of producers/consumers
  4. int producers = 1; // number of producers
  5. int consumers = 1; // number of consumers
  6. int *buffer; // the buffer itself: malloc in main()
  7. int max; // size of the producer/consumer buffer
  8. int use_ptr = 0; // tracks where next consume should come from
  9. int fill_ptr = 0; // tracks where next produce should go to
  10. int num_full = 0; // counts how many entries are full
  11. int loops; // number of items that each producer produces
  12. #define EMPTY (-2) // buffer slot has nothing in it
  13. #define END_OF_STREAM (-1) // consumer who grabs this should exit
  14. #endif // __pc_header_h__