#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);
}
unsigned long hash = jhash(&value, sizeof(value), seed);
printf("lookup key: %d\n", value);
unsigned long hash = jhash(&value, sizeof(value), seed);
printf("lookup key: %d\n", value);
cds_lfht_for_each_entry_duplicate(ht, hash, match,
&value, &iter, node, node) {
printf(" (key %d, seqnum %d) found\n",
node->value, node->seqnum);
}
cds_lfht_for_each_entry_duplicate(ht, hash, match,
&value, &iter, node, node) {
printf(" (key %d, seqnum %d) found\n",
node->value, node->seqnum);
}