about summary refs log tree commit diff stats
path: root/src/common/shared_memory.h
blob: 53c7fb752b30c79be7bb7ddba5a22dd6128f1f1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
};