Skip to content

Conversation

@elbeno
Copy link
Contributor

@elbeno elbeno commented Oct 10, 2024

Problem:

  • It is useful to have atomic semantics on a bitset.

Solution:

  • Add atomic_bitset.

Notes:

  • std::atomic<stdx::bitset<N, std::uintXX_t>> is unwieldy and could not guarantee the use of atomic instructions.
  • stdx::bitset<N, std::atomic<std::uintXX_t>> would not provide the right atomic semantics.
  • The API of atomic_bitset differs from the API of bitset in some important ways, but is intended to provide for the use case of effectively using an atomic integral type as a bitset.

@elbeno elbeno force-pushed the atomic-bitset branch 2 times, most recently from 9dea92b to be7ba11 Compare October 10, 2024 23:25
@lukevalenty
Copy link
Contributor

Ohhh....this looks cool! 😎 I'm going to take a close look at it later.

@elbeno elbeno force-pushed the atomic-bitset branch 2 times, most recently from 31df61e to 14e4ebd Compare October 11, 2024 15:03
Copy link
Contributor

@lukevalenty lukevalenty left a comment

Choose a reason for hiding this comment

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

Still looking through the implementation and tests of atomic bitset....will have more feedback soon!

Problem:
- It is useful to have atomic semantics on a bitset.

Solution:
- Add `atomic_bitset`.

Notes:
- `std::atomic<stdx::bitset<N, std::uintXX_t>>` is unwieldy and could not
  guarantee the use of atomic instructions.
- `stdx::bitset<N, std::atomic<std::uintXX_t>>` would not provide the right
  atomic semantics.
- The API of `atomic_bitset` differs from the API of `bitset` in some important
  ways, but is intended to provide for the use case of effectively using an
  atomic integral type as a bitset.
@lukevalenty lukevalenty merged commit 59a6cb1 into intel:main Oct 12, 2024
32 checks passed
@elbeno elbeno deleted the atomic-bitset branch October 13, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants