Skip to content
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

refactor: Make CCheckQueue RAII-styled #18731

Closed
wants to merge 7 commits into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Apr 22, 2020

This PR:

  • makes CCheckQueue RAII-styled
  • gets rid of two global variables:
    • scriptcheckqueue
    • g_parallel_script_checks

This PR is based on #18710, therefore only the last two commits should be considered.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 22, 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.

@hebasto hebasto marked this pull request as draft April 25, 2020 00:33
@hebasto hebasto changed the title refactor: Make CCheckQueue RAII-styled [WIP] refactor: Make CCheckQueue RAII-styled Apr 25, 2020
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK RAII style.

Need to fix test/fuzz/checkqueue.cpp in lines 41 and 42.

@hebasto hebasto force-pushed the 200421-queue-raii branch from ba61343 to 3553bde Compare April 28, 2020 18:48
@hebasto hebasto changed the title [WIP] refactor: Make CCheckQueue RAII-styled refactor: Make CCheckQueue RAII-styled Apr 28, 2020
@hebasto hebasto marked this pull request as ready for review April 28, 2020 19:26
@hebasto
Copy link
Member Author

hebasto commented Apr 28, 2020

Rebased ba61343 -> 3553bde (pr18731.01 -> pr18731.02) and ready for review.

@hebasto hebasto marked this pull request as draft April 28, 2020 23:47
@hebasto hebasto changed the title refactor: Make CCheckQueue RAII-styled [WIP] refactor: Make CCheckQueue RAII-styled Apr 28, 2020
@hebasto hebasto force-pushed the 200421-queue-raii branch 2 times, most recently from ac16422 to 01be64d Compare May 1, 2020 02:39
@hebasto
Copy link
Member Author

hebasto commented May 1, 2020

Updated 3553bde -> 01be64d (pr18731.02 -> pr18731.04, diff):

  • copy constructor and copy assignment are disabled

And this PR is ready for review, finally.

@hebasto hebasto marked this pull request as ready for review May 1, 2020 03:43
@hebasto hebasto changed the title [WIP] refactor: Make CCheckQueue RAII-styled refactor: Make CCheckQueue RAII-styled May 1, 2020
@hebasto hebasto force-pushed the 200421-queue-raii branch from 01be64d to 3fa8587 Compare May 26, 2020 17:42
@hebasto
Copy link
Member Author

hebasto commented Sep 24, 2020

Rebased e5a82de -> 56d40da (pr18731.14 -> pr18731.15) due to the conflict with #19927.

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 9, 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 marked this pull request as draft December 19, 2020 17:33
@DrahtBot
Copy link
Contributor

There hasn't been much activity lately and the patch still needs rebase. What is the status here?
  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

1 similar comment
@DrahtBot
Copy link
Contributor

There hasn't been much activity lately and the patch still needs rebase. What is the status here?
  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@jonatack
Copy link
Member

#18710 was merged, so this could be rebased and brought out of draft if you are still working on this.

@hebasto
Copy link
Member Author

hebasto commented Apr 22, 2022

I won't be able to focus on this stuff in the near future.

So closing up for grabs.

@hebasto
Copy link
Member Author

hebasto commented Dec 28, 2022

I won't be able to focus on this stuff in the near future.

So closing up for grabs.

#26762.

@hebasto hebasto deleted the 200421-queue-raii branch December 28, 2022 13:18
achow101 added a commit that referenced this pull request Nov 30, 2023
5b3ea5f refactor: Move `{MAX,DEFAULT}_SCRIPTCHECK_THREADS` constants (Hennadii Stepanov)
6e17b31 refactor: Make `CCheckQueue` non-copyable and non-movable explicitly (Hennadii Stepanov)
8111e74 refactor: Drop unneeded declaration (Hennadii Stepanov)
9cf89f7 refactor: Make `CCheckQueue` constructor start worker threads (Hennadii Stepanov)
d03eaac Make `CCheckQueue` destructor stop worker threads (Hennadii Stepanov)
be4ff30 Move global `scriptcheckqueue` into `ChainstateManager` class (Hennadii Stepanov)

Pull request description:

  This PR:
  - makes `CCheckQueue` RAII-styled
  - gets rid of the global `scriptcheckqueue`
  - fixes #25448

  The previous attempt was in #18731.

ACKs for top commit:
  martinus:
    ACK 5b3ea5f
  achow101:
    ACK 5b3ea5f
  TheCharlatan:
    ACK 5b3ea5f

Tree-SHA512: 45cca846e7ed107e3930149f0b616ddbaf2648d6cde381f815331b861b5d67ab39e154883ae174b8abb1dae485bc904318c50c51e5d6b46923d89de51c5eadb0
@bitcoin bitcoin locked and limited conversation to collaborators Dec 28, 2023
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.

5 participants