I have noticed that in the Bitcoin source code, almost all thread-safe sections use RecursiveGuard
.
As we all know, RecursiveGuard
is exclusive, which can impact system performance and concurrency.
At the same time, I have also noticed another issue specifically tracking the replacement of RecursiveMutex
with Mutex
, which would help reduce some of the locking overhead.
However, I think Mutex
is still exclusive. For modules like the transaction pool, which involve both reading and writing transactions—such as querying pending transactions and inserting new ones.
wouldn’t using a read-write lock (SharedMutex)
directly provide better performance? If I make this kind of modification, is it officially recommended?