]> 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>
Wed, 2 Jul 2025 14:07:07 +0000 (16:07 +0200)
commit974c3aedf313cecc40d0478de1f299f1e8def8dc
treebc4c5ff2c2234da5b905c249c7255e895a93843f
parent92e5c645f2fb8e700020c7eecd054e502f767acf
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>
(cherry picked from commit c340aa91bf37d8105d2b2390eecbadfca88c1d27)
ext/lmdb-safe/lmdb-safe.cc
ext/lmdb-safe/lmdb-safe.hh