]> git.ipfire.org Git - thirdparty/pdns.git/commit
lmdb-safe: Improve the scalability of transaction maps
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 27 Jun 2025 10:12:29 +0000 (12:12 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 27 Jun 2025 10:15:35 +0000 (12:15 +0200)
commitc340aa91bf37d8105d2b2390eecbadfca88c1d27
tree13b6c000a87a277834b345c5eb0faa7c20df9172
parenta44ba546fcaac31496ce67dcbf580e1b5804d4e0
lmdb-safe: Improve the scalability of transaction maps

This commit improves the scalability of the transaction maps by
moving from a `mutex` to a `shared_mutex` and making the stored value
atomic. This allows accessing the maps concurrently from different threads
as long as the entry for the thread exists, and we fall back to
taking a full lock otherwise.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
ext/lmdb-safe/lmdb-safe.cc
ext/lmdb-safe/lmdb-safe.hh