concurrency - Hash map with concurrent values (in C++) -


i have hash map, string key pointer thread-safe class. each object of class contains mutex use synchronize between various methods.

in addition, every once in while want discard values not used time. want able safely delete value pointer , remove hash map, while making sure no 1 uses value.

what's best way achieve (in general, , in c++)?

if want people use hash map these pointers able keep using them without having notify hash map class they've finished it, storing shared pointers in hash map easiest way time actual object deletion time last user of object finishes it. hash map free erase it's shared pointer object @ time.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -