summaryrefslogtreecommitdiffstats
path: root/collectors/statsd.plugin
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-06-28 17:48:11 +0300
committerGitHub <noreply@github.com>2022-06-28 17:48:11 +0300
commitaa3be2f0647ace385e5ffb475a3e145f38458e6e (patch)
tree23ad01136e8ccf855483a91c4881dd0ca5a85830 /collectors/statsd.plugin
parentc3dfbe52a61dd0d1995bc420b0e0576cf058fd74 (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/statsd.plugin')
-rw-r--r--collectors/statsd.plugin/statsd.c2
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) {