#include <urcu/rculfhash.h> /* RCU Lock-free hash table */
#include <urcu/compiler.h> /* For CAA_ARRAY_SIZE */
#include "jhash.h" /* Example hash function */
#include <urcu/rculfhash.h> /* RCU Lock-free hash table */
#include <urcu/compiler.h> /* For CAA_ARRAY_SIZE */
#include "jhash.h" /* Example hash function */
- ht = cds_lfht_new(1, 1, 0,
+ ht = cds_lfht_new_flavor(1, 1, 0,
cds_lfht_add(ht, hash, &node->node);
printf("Add (key: %d, seqnum: %d)\n",
node->value, node->seqnum);
cds_lfht_add(ht, hash, &node->node);
printf("Add (key: %d, seqnum: %d)\n",
node->value, node->seqnum);
cds_lfht_for_each_entry(ht, &iter, node, node) {
printf(" (key: %d, seqnum: %d)",
node->value, node->seqnum);
}
cds_lfht_for_each_entry(ht, &iter, node, node) {
printf(" (key: %d, seqnum: %d)",
node->value, node->seqnum);
}
int value = lookup_values[i];
unsigned long hash = jhash(&value, sizeof(value), seed);
int value = lookup_values[i];
unsigned long hash = jhash(&value, sizeof(value), seed);
cds_lfht_lookup(ht, hash, match, &value, &iter);
ht_node = cds_lfht_iter_get_node(&iter);
if (!ht_node) {
cds_lfht_lookup(ht, hash, match, &value, &iter);
ht_node = cds_lfht_iter_get_node(&iter);
if (!ht_node) {
printf("(key %d, seqnum %d) found\n",
node->value, node->seqnum);
}
printf("(key %d, seqnum %d) found\n",
node->value, node->seqnum);
}