diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2022-06-28 17:48:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 17:48:11 +0300 |
commit | aa3be2f0647ace385e5ffb475a3e145f38458e6e (patch) | |
tree | 23ad01136e8ccf855483a91c4881dd0ca5a85830 /collectors | |
parent | c3dfbe52a61dd0d1995bc420b0e0576cf058fd74 (diff) |
Dictionaries with reference counters and full deletion support during traversal (#13195)
* dont use atomic operations when not needed; detect misuse of the the unsafe functions
* use relaxed atomic operations for statistics
* use relaxed atomic operations for statistics
* dictionaries now use reference counters, allowing deletetions of any item while traversing it
* added acquire/release interface to dictionaries
* added unittest for reference counters
* added NETDATA_INTERNAL_CHECKS logs to detect non-exclusive access to crusial parts of the dictionaries
* dictionaries cannot be deleted while there are referenced items in them - they will be deleted once the last item gets unreferenced
* cleanup
* properly cleanup released items
* maintain counters for readers and writers; defer all deletes on sorted walkthrough; cleaner internal_error();
* somewhat faster reference counters on single threaded dictionaries
* minor optimizations; allow compiling without internal checks
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/statsd.plugin/statsd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/collectors/statsd.plugin/statsd.c b/collectors/statsd.plugin/statsd.c index dbdfd1c7a6..e42c0eacb9 100644 --- a/collectors/statsd.plugin/statsd.c +++ b/collectors/statsd.plugin/statsd.c @@ -390,7 +390,7 @@ static void dictionary_metric_insert_callback(const char *name, void *value, voi netdata_mutex_init(&m->histogram.ext->mutex); } - __atomic_fetch_add(&index->metrics, 1, __ATOMIC_SEQ_CST); + __atomic_fetch_add(&index->metrics, 1, __ATOMIC_RELAXED); } static void dictionary_metric_delete_callback(const char *name, void *value, void *data) { |