Update hazard pointers interface and implementation
authorMaged Michael <magedmichael@fb.com>
Mon, 31 Oct 2016 21:47:41 +0000 (14:47 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Mon, 31 Oct 2016 21:54:29 +0000 (14:54 -0700)
commitc45de72c4d1753ffca4f8e528909e4729da5191b
tree3ff6a54d7f72ddc60f9ac1ca44f9e35573462e40
parent21d7adcd34a367bd6708a2438161b92307c4b53f
Update hazard pointers interface and implementation

Summary:
The main purpose of this diff and this library at this point is to be a public reference for the C++ standard committee and whoever is interested in the proposal to the committee.

This diff aims to be consistent with the latest version of the proposal (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0233r2.pdf).

The current interface proposal focuses on the core components (domain, object base, and raii owner). Once, that part is settled we can add to the interface:
- Thread local options (thread caching of hazard pointers and private storage of retired objects)
- Programmer control of reclamation (when and by which threads)
Also, at this point the implementation does not optimize memory ordering.

I removed hazptr_domain::try_reclaim() from the public interface at this point. The latest update to interface aims to relieve the programmer from the need to take spacial precautions against shutdown fiascos involving reclamation functions of objects stored by the default domain. Please let me know if you have any concerns about this.

Having said that about the current purpose of this library, I really appreciate any comments (in this diff or separately) on the interface in general and any suggestions for the eventual optimized implementation.

Reviewed By: davidtgoldblatt

Differential Revision: D4104381

fbshipit-source-id: df98adf6fd9b7a93406cb8eeca8fe2ad12388139
folly/experimental/hazptr/hazptr-impl.h
folly/experimental/hazptr/hazptr.h
folly/experimental/hazptr/test/HazptrTest.cpp