diff options
| -rw-r--r-- | src/common/shared_memory.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/shared_memory.h b/src/common/shared_memory.h new file mode 100644 index 0000000..53c7fb7 --- /dev/null +++ b/src/common/shared_memory.h @@ -0,0 +1,16 @@ +#pragma once + +#include <pthread.h> + +#define QUEUE_SIZE 10 +#define SHM_NAME "/hashtable_queue" + +enum Operations { INSERT, DELETE, GET }; + +struct SharedMemory { + pthread_mutex_t mutex; + pthread_cond_t cond_var; + Operations queue[QUEUE_SIZE]; + int head; + int tail; +}; |