|
Blender V4.3
|
#include <BLI_concurrent_map.hh>
Public Types | |
| using | size_type = int64_t |
| using | MutableAccessor = Accessor |
| using | ConstAccessor = Accessor |
Public Member Functions | |
| bool | lookup (Accessor &accessor, const Key &key) |
| bool | add (Accessor &accessor, const Key &key) |
| bool | remove (const Key &key) |
A #ConcurrentMap allows adding, removing and looking up values from multiple threads concurrently. It has higher memory and performance overhead than a simple #Map when not used concurrently though.
For thread-safety, one always has the use an accessor to retrieve or update values. This makes sure that only one thread can modify a value at a time. Multiple threads may read from the same key at the same time though.
This is a thin wrapper around #tbb::concurrent_hash_map that also has a fallback implementation if TBB is not available. The fallback implementation is not optimized for performance. It mainly intends to be a simple implementation that can compile whenever the TBB variant can compile.
Definition at line 55 of file BLI_concurrent_map.hh.
| using blender::ConcurrentMap< Key, Value, Hash, IsEqual >::ConstAccessor = Accessor |
Definition at line 181 of file BLI_concurrent_map.hh.
| using blender::ConcurrentMap< Key, Value, Hash, IsEqual >::MutableAccessor = Accessor |
Definition at line 180 of file BLI_concurrent_map.hh.
| using blender::ConcurrentMap< Key, Value, Hash, IsEqual >::size_type = int64_t |
Definition at line 57 of file BLI_concurrent_map.hh.
|
inline |
Definition at line 194 of file BLI_concurrent_map.hh.
Referenced by blender::memory_cache::get_base().
|
inline |
Definition at line 183 of file BLI_concurrent_map.hh.
Referenced by blender::memory_cache::get_base(), and blender::memory_cache::try_enforce_limit().
|
inline |
Definition at line 203 of file BLI_concurrent_map.hh.
References lock.
Referenced by blender::memory_cache::clear(), and blender::memory_cache::try_enforce_limit().