Skip to content

fix: correct AtomicBitVec::set behaviour#18

Merged
tomtomwombat merged 1 commit intotomtomwombat:mainfrom
IgorErin:iea/correct-atomic-set
Jan 10, 2026
Merged

fix: correct AtomicBitVec::set behaviour#18
tomtomwombat merged 1 commit intotomtomwombat:mainfrom
IgorErin:iea/correct-atomic-set

Conversation

@IgorErin
Copy link
Contributor

In original code set performs load and fetch_or afterwards. But if two threads simulteniously perform set it possible that no one would observe true as result of set operation.

We can avoid using load and just fetch_or and check fetched value.

In original code `set` performs `load` and `fetch_or` afterwards.
But if two threads simulteniously perform `set` it possible that
no one would observe `true` as result of `set` operation.

We can avoid using `load` and just `fetch_or` and check `fetch`ed value.
@tomtomwombat
Copy link
Owner

thanks for catching this and cleaning it up!

@tomtomwombat tomtomwombat merged commit 3bba65f into tomtomwombat:main Jan 10, 2026
1 of 2 checks passed
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