cplusplus / cplusplus/draft

[atomics.types.operations]p20's note makes incorrect assumptions about atomic representation

Open
#2,104 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

sg1
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

[ Note: For example, the effect of compare_exchange_strong is

if (memcmp(this, &expected, sizeof(*this)) == 0)
  memcpy(this, &desired, sizeof(*this));
else
  memcpy(expected, this, sizeof(*this));

end note ]

This is wrong in a multitude of ways... not least of which is that that's not even atomic. But also this assumes that sizeof(atomic<T>) == sizeof(T), that the layout of an atomic directly contains a T, and so on.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the [atomics.types.operations] p20 note quoted in the issue and read the surrounding atomic operation wording. Verify the note against the stated atomic representation and compare_exchange semantics; done requires a maintainer-approved correction or removal that no longer makes the listed representation and atomicity assumptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.