4600-project-1/inc/globals.hpp
John Breaux 478778841e Make variable names more accurate
Make functions more functional
Make comments more commentary
2022-04-05 15:37:42 -05:00

20 lines
529 B
C++

#define N 8
#define timescale 5
//function defines, renaming wait and signal
#define wait(x) sem_wait(&x)
#define signal(x) sem_post(&x)
// Shared memory through global variables
// Create all of memory
extern block memory[N];
// create the three lists
extern list lists[3];
extern list *freelist, *list1, *list2;
// count semaphores
extern sem_t sem_freelist, sem_list1, sem_list2;
// binary semaphores
extern sem_t mut_freelist, mut_list1, mut_list2;
// binary semaphores for reading/writing
extern sem_t mut_take, mut_give;