diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2022-11-02 16:56:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 16:56:58 +0200 |
commit | 4aeb68234dabbb414a0b0c1599b670c02530b1c5 (patch) | |
tree | 6916cba77e5a278956d6ffec414067fe77174701 /libnetdata/dictionary | |
parent | a581f2f647e741f7dbdbb8554996cf72b390afb1 (diff) |
Statsd dictionaries should be multi-threaded (#13938)
* the new dictionaries do not support concurrent use without locks
* update dictionaries readme
Diffstat (limited to 'libnetdata/dictionary')
-rw-r--r-- | libnetdata/dictionary/README.md | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/libnetdata/dictionary/README.md b/libnetdata/dictionary/README.md index fc7b889fb5..6d7e55392e 100644 --- a/libnetdata/dictionary/README.md +++ b/libnetdata/dictionary/README.md @@ -229,12 +229,3 @@ There are 2 versions of `dfe_start`: While in the loop, depending on the read or write versions of `dfe_start`, the caller may lookup or manipulate the dictionary. The rules are the same with the unsorted walkthrough callback functions. PS: DFE is Dictionary For Each. - -## special multi-threaded lockless case - -Since the dictionary uses a hash table and a double linked list, if the contract between 2 threads is for one to use the hash table functions only (`set`, `get` - but no `del`) and the other to use the traversal ones only, the dictionary allows concurrent use without locks. - -This is currently used in statsd: - -- the data collection thread uses only `get` and `set`. It never uses `del`. New items are added at the front of the linked list (`DICT_OPTION_ADD_IN_FRONT`). -- the flushing thread is only traversing the dictionary up to the point it last traversed it (it uses a flag for that to know where it stopped last time). It never uses `get`, `set` or `del`. |