Skip to content

Commit

Permalink
Fix the potential bug inserting a new key before the new hash table i…
Browse files Browse the repository at this point in the history
…s persistently swapped
  • Loading branch information
SeKwonLee committed Apr 20, 2021
2 parents 39c58cc + 94dc38f commit fc508dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions P-CLHT/src/clht_lb_res.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,9 @@ ht_resize_pes(clht_t* h, int is_increase, int by)

// atomically swap the root pointer
// Presume the head of "h" contains the pointer (offset) to the hash table
SWAP_U64((uint64_t*) h, (uint64_t) pmemobj_oid(ht_new).off);
clflush((char *)h, sizeof(uint64_t), false, true);
//SWAP_U64((uint64_t*) h, (uint64_t) pmemobj_oid(ht_new).off);
//clflush((char *)h, sizeof(uint64_t), false, true);
movnt64((uint64_t)&h->ht_off, (uint64_t)pmemobj_oid(ht_new).off, false, true);

DEBUG_PRINT("Parent reached correctly\n");
ht_old->table_new = ht_new;
Expand Down

0 comments on commit fc508dd

Please sign in to comment.