Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Sep 6, 2020

This is another step to transit CTxMemPool::cs from RecursiveMutex to Mutex.
Split out from #19306. (Along with #19652, #19854 and #19872 it is more than 2/3 of the way to the final goal).

Thread safety annotations, lock assertions, and required explicit locking added. No behavior change.

Please note that now, since #19668 has been merged, it is safe to apply AssertLockHeld() macros as they do not swallow compile time Thread Safety Analysis warnings.

@maflcko
Copy link
Member

maflcko commented Sep 6, 2020

Looks like this is adding a lot of code (complexity). Not sure if that is worth it.

@hebasto
Copy link
Member Author

hebasto commented Sep 6, 2020

Looks like this is adding a lot of code (complexity). Not sure if that is worth it.

Since the memory unused by the mempool could be used by the coinscache, CTxMemPool::DynamicMemoryUsage() is buried in CChainState::GetCoinsCacheSizeState(). The code could be much simpler if every entity will have its own memory limit.

@hebasto
Copy link
Member Author

hebasto commented Sep 6, 2020

@MarcoFalke

Not sure if that is worth it.

http://www.erisian.com.au/bitcoin-core-dev/log-2020-06-18.html#l-16:

<sipa> recursive mutexes are evil

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 15, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 1, 2020

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@hebasto hebasto closed this Aug 24, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants