Skip to content

Warning about using std::counting_semaphore #5595

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

vlntb
Copy link
Collaborator

@vlntb vlntb commented Jul 22, 2025

High Level Overview of Change

Comment added.

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@lmaisons
Copy link
Collaborator

Is it worth sticking a pragma message in there for GCC and Clang versions higher than our targets?

@vlntb vlntb force-pushed the vlntb/semaphore-use-comment branch from 55ece54 to 8064975 Compare July 22, 2025 17:52
@vlntb
Copy link
Collaborator Author

vlntb commented Jul 22, 2025

Is it worth sticking a pragma message in there for GCC and Clang versions higher than our targets?

We discussed this and decided that it is not worth it. Most of the deployments today will not be able to take advantage of this optimisation.

@vlntb vlntb marked this pull request as ready for review July 22, 2025 17:54
@vlntb vlntb added the Trivial Simple change with minimal effect, or already tested. Only needs one approval. label Jul 22, 2025
@lmaisons
Copy link
Collaborator

lmaisons commented Jul 22, 2025

That's fair. I have experience with features waiting on 'eventual' compiler support (7 8 years and counting?), so may be untowardly prone to defensiveness in the area...

Copy link

codecov bot commented Jul 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.8%. Comparing base (baf4b83) to head (76c5943).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5595     +/-   ##
=========================================
- Coverage     78.8%   78.8%   -0.0%     
=========================================
  Files          814     814             
  Lines        71261   71262      +1     
  Branches      8368    8369      +1     
=========================================
  Hits         56131   56131             
- Misses       15130   15131      +1     
Files with missing lines Coverage Δ
src/xrpld/core/detail/semaphore.h 100.0% <ø> (ø)

... and 3 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* * GCC PR 104928: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104928
* * LLVM PR 79265: https://github.com/llvm/llvm-project/pull/79265
*
* Once the minimum compiler version is updated to GCC 13.3 or Clang 17, we can
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think that's fixed in gcc 13.3 , given that its release date is May 2024 and the bug was fixed in June 2025 in https://gcc.gnu.org/cgit/gcc/commit/?id=7be4913b8f8b1e1474751656d45b301aa0c20790 . It might have been fixed in gcc 13.4 (released in June 2025) but we would have to verify that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are correct. Checked and updated.

@vlntb vlntb requested a review from Bronek July 30, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trivial Simple change with minimal effect, or already tested. Only needs one approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants