Skip to content

Commit

Permalink
Fix a potential bug inserting new keys before the new hash table is p…
Browse files Browse the repository at this point in the history
…ersistently swapped
  • Loading branch information
SeKwonLee committed Apr 20, 2021
1 parent ccb31d9 commit 94dc38f
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 @@ -756,8 +756,9 @@ ht_resize_pes(clht_t* h, int is_increase, int by)
#endif

// atomically swap the root pointer
SWAP_U64((uint64_t*) h, (uint64_t) ht_new);
clflush((char *)h, sizeof(uint64_t), false, true);
//SWAP_U64((uint64_t*) h, (uint64_t) ht_new);
//clflush((char *)h, sizeof(uint64_t), false, true);
movnt64((uint64_t)&h->ht, (uint64_t)ht_new, false, true);

#if defined(CRASH_AFTER_SWAP_CLHT)
pid_t pid1 = fork();
Expand Down

0 comments on commit 94dc38f

Please sign in to comment.