This class creates core-local caches for a given shared_ptr, to mitigate contention when acquiring/releasing it.
Declared in <folly/concurrency/CoreCachedSharedPtr.h>
template<
class T,
size_t kMaxSlots = kCoreCachedSharedPtrDefaultMaxSlots>
class CoreCachedSharedPtr;
It has the same thread-safety guarantees as shared_ptr: it is safe to concurrently call get(), but reset()s must be synchronized with reads and other reset()s.
| Name | Description |
|---|---|
CoreCachedSharedPtr [constructor] | Constructors |
get | Returns the shared pointer cached for the current core. |
reset | Replaces the held pointer, repopulating the core-local caches. |
| Name | Description |
|---|---|
folly::CoreCachedWeakPtr | Core-local cache of weak pointers to a shared object. |