start of new file
[IRC.git] / Robust / src / Runtime / DSTM / interface / prelookup.h
index 0f68d20bac08840e01d7831e6715a8b24ee4b71d..8b4c30be564dafde79624893bc2885528e3cca3e 100644 (file)
@@ -4,8 +4,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <pthread.h>
+#include "dstm.h"
 
-#define LOADFACTOR 0.75
+#define LOADFACTOR 0.5
 #define HASH_SIZE 100
 
 typedef struct prehashlistnode {
@@ -14,12 +15,18 @@ typedef struct prehashlistnode {
        struct prehashlistnode *next;
 } prehashlistnode_t;
 
+struct objstr;
+
 typedef struct prehashtable {
-       prehashlistnode_t *table;       // points to beginning of hash table
-       unsigned int size;
-       unsigned int numelements;
-       float loadfactor;
-       pthread_mutex_t lock;
+  prehashlistnode_t *table;    // points to beginning of hash table
+  unsigned int size;
+  unsigned int numelements;
+  float loadfactor;
+  pthread_mutex_t lock;
+  pthread_mutexattr_t prefetchmutexattr;
+  pthread_cond_t cond;
+  struct objstr *hack2;
+  struct objstr *hack;
 } prehashtable_t;
 
 /* Prototypes for hash*/
@@ -29,6 +36,7 @@ unsigned int prehashInsert(unsigned int key, void *val);
 void *prehashSearch(unsigned int key); //returns val, NULL if not found
 unsigned int prehashRemove(unsigned int key); //returns -1 if not found
 unsigned int prehashResize(unsigned int newsize);
+void prehashClear();
 /* end hash */
 
 #endif