diff options
Diffstat (limited to '')
| -rw-r--r-- | src/common/shared_memory.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/common/shared_memory.h b/src/common/shared_memory.h index 43fe2f5..70554e4 100644 --- a/src/common/shared_memory.h +++ b/src/common/shared_memory.h @@ -4,6 +4,8 @@ #include <sstream> #define SHM_NAME "/hashtable_queue" +#define QUEUE_SIZE 10 + #define MAX_KEY_SIZE 64 #define MAX_VALUE_SIZE 128 @@ -13,12 +15,17 @@ struct Request { Operations type; char key[MAX_KEY_SIZE]; char value[MAX_VALUE_SIZE]; + char response[MAX_VALUE_SIZE]; }; struct SharedMemory { - Request request; - bool processed; - char response[MAX_VALUE_SIZE]; + Request request[QUEUE_SIZE]; + pthread_mutex_t mutex; + pthread_cond_t cond_var; + + int tail; + int head; + bool full; }; template <typename T> |