|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Reusable hot-path optimization patterns for concurrent map access. More...
#include <shared_mutex>

Go to the source code of this file.
Namespaces | |
| namespace | kcenon |
| namespace | kcenon::monitoring |
| namespace | kcenon::monitoring::hot_path |
Functions | |
| template<typename Map , typename Key , typename CreateFn > | |
| auto | kcenon::monitoring::hot_path::get_or_create (Map &map, std::shared_mutex &mutex, const Key &key, CreateFn create_fn) -> typename std::remove_reference< decltype(*map.begin() ->second)>::type * |
| template<typename Map , typename Key , typename CreateFn , typename InitFn > | |
| auto | kcenon::monitoring::hot_path::get_or_create_with_init (Map &map, std::shared_mutex &mutex, const Key &key, CreateFn create_fn, InitFn init_fn) -> typename std::remove_reference< decltype(*map.begin() ->second)>::type * |
| template<typename Map , typename Key , typename CreateFn , typename UpdateFn > | |
| auto | kcenon::monitoring::hot_path::get_or_create_and_update (Map &map, std::shared_mutex &mutex, const Key &key, CreateFn create_fn, UpdateFn update_fn) -> decltype(update_fn(*map.begin() ->second)) |
Reusable hot-path optimization patterns for concurrent map access.
Provides thread-safe get-or-create patterns using double-check locking with shared_mutex for optimal read performance on hot paths.
The pattern reduces lock contention by:
Definition in file hot_path_helper.h.