forked from remzi-arpacidusseau/ostep-homework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pc-header.h
22 lines (14 loc) · 789 Bytes
/
pc-header.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __pc_header_h__
#define __pc_header_h__
#define MAX_THREADS (100) // maximum number of producers/consumers
int producers = 1; // number of producers
int consumers = 1; // number of consumers
int *buffer; // the buffer itself: malloc in main()
int max; // size of the producer/consumer buffer
int use_ptr = 0; // tracks where next consume should come from
int fill_ptr = 0; // tracks where next produce should go to
int num_full = 0; // counts how many entries are full
int loops; // number of items that each producer produces
#define EMPTY (-2) // buffer slot has nothing in it
#define END_OF_STREAM (-1) // consumer who grabs this should exit
#endif // __pc_header_h__