folly icon indicating copy to clipboard operation
folly copied to clipboard

Change HazptrHoler try_protect memory fence from light to heavy

Open ehds opened this issue 2 months ago • 0 comments

The protected pointer placed in hprec_ (store) should not be reordered after to read hazptr_obj (load). folly::asymmetric_thread_fence_light on Linux only prevents compiler reordering, but cannot prevent CPU reordering (x86 allows store-load reorder).

Therefore the load operation may be executed first but the protected pointer has not yet placed to hprec_, if there some other threads try to retire this hazptr, it might be success.

ehds avatar Oct 18 '25 07:10 ehds