-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Add local thread pool to CCheckQueue #18710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Concept ACK on getting rid of boost in consensus code. This pull looks similar to #14464? |
cc @JeremyRubin |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
9764d81
to
f4cd37e
Compare
Updated 9764d81 -> f4cd37e (pr18710.01 -> pr18710.02, diff):
|
Nice! From a simple code review PoV it looks good. I remember there being a bunch of subtle nasties in the specifics of using std::threads v.s. boost threads around interrupt system and the details of how condition variables work. I can't remember what they all were though now. I think #14464 closed because of that... But generally huge concept ack on anything that makes #9938 more likely to move forward! Note though that the cuckoocache sort of stole it's thunder -- a lot of the contention in the CheckQueue was around the sigcache locking and the cuckoocache made that stuff way faster so it's not obvious #9938 will show as impressive gains, and the trade offs for consensus code may be less worth it. Can discuss more via IRC; I'd love to get some of the improvements through in any case. |
The differences from #14464 are:
|
f4cd37e
to
b02bc25
Compare
Updated f4cd37e -> b02bc25 (pr18710.02 -> pr18710.03, diff):
|
Benchmark results on my machine:
|
b02bc25
to
f16f7f7
Compare
Rebased b02bc25 -> f16f7f7 (pr18710.03 -> pr18710.04) due to the conflict with #18575. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach ACK f16f7f7 🌘
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Approach ACK f16f7f79dcd5d6c1b55966317b8762abeb5561c3 🌘
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUhhpwv+NPSS8v5sdXJqBUVegg4/8o1tsvoNpU9cE80q4qYqkmrP2V55QWbkG2VI
NE6+E0XSgTx8UuESI+9YEJ9+8gH4jCgNIqDMS4dqG+uPeeTXJUKn39Jn59YuaJGQ
yWCCO4BZXqW/DWCLVpcDINXGtlZgFR3sv53RiFPWw+NNU5aJYTFssv9KJ8nBQVko
SXNKSNzFxqx2oafuIaF+Ikrp+HbPzwE7Xrk2byS9Od1sA8d/LGkbhxBB4j32L4NT
8NNUBKdata4zjzkQCXHIrBYNxJxy8/qK45lMO4WjiApxyA5kbbOZ20v9eyh8oF5I
4hsvQN1Bpvdm8hK3oqxcLzZ2/QO6SjkNnVslNlFeYubasFMoTGS7n0SMqgmqgIbW
qi9sMpsuMEBov6wq5kCIpWTBwHIuDMeRbjo/dOkJcTNqJHu8+s83aqD8P3MbTa0y
ykeCbWwB8k0v5SPGhKMRx5sUMOGHQBWboDRzDJmNF909W+Yd3DL+C0qONk6vvMSy
03UYQCgR
=16Sm
-----END PGP SIGNATURE-----
Timestamp of file with hash fd6cc8b78bfb432d1fffbc1706dd13c7f3563a0d2caef6be9b45688ccd1b15ad -
f16f7f7
to
7a7e346
Compare
Updated f16f7f7 -> 7a7e346 (pr18710.04 -> pr18710.05, diff):
|
In the last commit: Could replace the last occurrence of |
7a7e346
to
6173917
Compare
Updated 7a7e346 -> 6173917 (pr18710.05 -> pr18710.06, diff):
|
@MarcoFalke |
dc8be12 refactor: remove boost::thread_group usage (fanquake) Pull request description: Post #18710, there isn't much left using `boost::thread_group`, so should just be able to replace it with the standard library. This also removes the last use of `boost::thread_interrupted`. After this change, last piece of Boost Thread we'd be using is `boost::shared_mutex`. See the commentary [here](#16684 (comment)) as to why it may be non-trivial to swap that for `std::shared_mutex` in the near future. Closes #17307 ACKs for top commit: laanwj: Code review re-ACK dc8be12 MarcoFalke: review ACK dc8be12 🔁 jonatack: Non-expert code review ACK dc8be12, also checked range-diff since last review and that local debug build is clean with gcc 10.2.1-6 on Debian Tree-SHA512: 5510e2d760cce824234207dc86b1551ca8f21cbf3a2ce753c0254a0d03ffd83c94e449aec202fb7bd76e6fc64df783a6b70a736b0add9ece3734bb9c8ce8fc2f
partial bitcoin#15842, merge bitcoin#15849, bitcoin#17342, bitcoin#18710: Add local thread pool to CCheckQueue
Backport of bitcoin/bitcoin#18710 PR message: This PR: gets rid of boost::thread_group in the CCheckQueue class allows thread safety annotation usage in the CCheckQueue class is alternative to #14464 (#18710 (comment), #18710 (comment)) Also, with this PR (I hope) it could be easier to resurrect a bunch of brilliant ideas from #9938. Related: #17307 Squashed commits: 0ef938685b5c079a6f5a98daf0e3865d718d817b refactor: Use member initializers in CCheckQueue 01511776acb0c7ec216dc9c8112531067763f1cb Add local thread pool to CCheckQueue dba30695fc42f45828db008e7e5b81cb2b5d8551 test: Use CCheckQueue local thread pool 6784ac471bb32b6bb8e2de60986f123eb4990706 bench: Use CCheckQueue local thread pool bb6fcc75d1ec94b733d1477c816351c50be5faf9 refactor: Drop boost::thread stuff in CCheckQueue Also in this commit: Slight modification to our custom CCheckQueue_32MB benchmark to use the new API. Signed-off-by: Calin Culianu <calin.culianu@gmail.com>
Summary: This is a backport of [[bitcoin/bitcoin#18710 | core#18710]] [1/4] bitcoin/bitcoin@0ef9386 Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10985
Summary: This is a backport of [[bitcoin/bitcoin#18710 | [[bitcoin/bitcoin#18710 | core#18710]]]] [2/4] bitcoin/bitcoin@0151177 bitcoin/bitcoin@dba3069 Depends on D10985 Test Plan: With TSAN: `ninja && ninja check check-functional` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D10986
Summary: This is a backport of [[bitcoin/bitcoin#18710 | core#18710]] [3/4] bitcoin/bitcoin@6784ac4 Depends on D10986 Test Plan: With TSAN: `ninja bitcoin-bench && TSAN_OPTIONS=suppressions=/home/pierre/dev/bitcoin-abc/test/sanitizer_suppressions/tsan src/bench/bitcoin-bench` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10987
Summary: This is a backport of [[bitcoin/bitcoin#18710 | core#18710]] [4/4] bitcoin/bitcoin@bb6fcc7 Depends on D10987 Test Plan: With TSAN: `ninja && ninja check check-functional` ``` cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ninja all check-all ``` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D10988
Summary: > Post [[bitcoin/bitcoin#18710 | core#18710]], there isn't much left using boost::thread_group, so should just be able to replace it with the standard library. This also removes the last use of `boost::thread_interrupted`. > > After this change, last piece of Boost Thread we'd be using is `boost::shared_mutex`. See the commentary [[https://github.com/bitcoin/bitcoin/issues/16684#issuecomment-726214696|here]] as to why it may be non-trivial to swap that for `std::shared_mutex` in the near future. This is a backport of [[bitcoin/bitcoin#21016 | core#21016]] and [[bitcoin/bitcoin#22433 | core#22433]] Test Plan: With clang + debug and (separate run) TSAN `ninja && ninja check check-functional` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D10992
This PR:
boost::thread_group
in theCCheckQueue
classCCheckQueue
classAlso, with this PR (I hope) it could be easier to resurrect a bunch of brilliant ideas from #9938.
Related: #17307