<atomic>: enable more atomic sizes, improve non-lock-free lock
Open
Nobody has claimed this yet.
performance
vNext
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
Several things should be done with atomics with new ABI
- #843 enables
atomic_ref<type_of_16_bytes_size>, but notatomic<type_of_16_bytes_size>, need to enable these as well - Some believe that x64 CPUs without
cmpxchg16bexist. Rule them out from vNext target hardware and use the instruction unconditionally. - Make sure non-lock-free atomics use OS wait. This can be done by replacing inner lock with
SRWLOCKorCRITICAL_SECTION, or by using ofWaitOnAddress, etc.SwitchToThreador timed backoff, or pure active spinning are not good options - Make sure
atomic<T>with odd size, such as 3 bytes are padded up to next native atomic size. Make sure it is done only foratomic, not foratomic_ref. - Consider eliminating pointer to
SRWLOCKinatomic_refand always locating it from pointer hash.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading #843 and #169, then confirm that the vNext branch is available before beginning. Review the atomic and atomic_ref implementation and address each listed ABI, lock-free, padding, and pointer-hashing requirement; done means the vNext changes are covered without the rejected spinning approaches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100