laanwj
commented at 10:46 AM on May 2, 2020:
member
This replaces the only use of thread_local with a mutex-protected map.
This leaks per thread, but because bitcoin's threads are static and permanent, this is not a problem in practice. Add a note to the thread rename function to only call it for permanent threads, just in case.
Also removes associated build system functionality.
refactor: Replace thread_local use with a mutex-protected map
This replaces the only use of `thread_local` with a mutex-protected map.
This leaks per thread, but because bitcoin's threads are static and
permanent, this is not a problem in practice. Add a note to the thread
rename function to only call it for permanent threads, just in case.
Also removes associated build system functionality.
Closes #18678.
c7933899e9
laanwj force-pushed on May 2, 2020
meshcollider
commented at 11:20 AM on May 2, 2020:
contributor
Concept / code review ACKc7933899e93b38f444d87b12858fd5a124f2066c modulo someone testing that it does fix the performance issue linked
MarcoFalke
commented at 11:47 AM on May 2, 2020:
member
Concept ACK if this fixes the problem. Will test when my new hardware arrives
laanwj
commented at 11:57 AM on May 2, 2020:
member
If this doesn't solve the problem, then the problem isn't thread_local but looking up thread names in the first place, and we should remove thread name logging completely (as well as thread_local).
A workaround then that would avoid the need for this bookkeeping at all would be:
Log thread names once with their associated ID after creation on thread name setting
Log thread IDs instead of names in log messages
DrahtBot
commented at 12:27 PM on May 2, 2020:
contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
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 removed the label Needs gitian build on May 4, 2020
laanwj
commented at 1:18 PM on May 4, 2020:
member
Okay. So is it still worth keeping this open? It would make thread-name logging work in the gitian-built binaries which lack thread_local. And cleans up the build system a bit.
hebasto
commented at 1:20 PM on May 4, 2020:
member
It would make thread-name logging work in the gitian-built binaries which lack thread_local. And cleans up the build system a bit.
Correct. So keep reviewing.
MarcoFalke
commented at 1:32 PM on May 4, 2020:
member
I am currently syncing a node to debug this issue.
Also, glibc can probably be bumped by one minor version in the next release, which is going to switch to C++17. Then, potentially the same build cleanups can be done?
laanwj closed this on May 4, 2020
MarcoFalke removed the label Needs Guix build on May 6, 2020
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:54 UTC