#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 {
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*/
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