How many objects or references are associated with a block variable with static storage duration(in multi-thread)?
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
void fun(){
static int value = 0;
}
int main(){
fun(); // in main thread
/* fun(); assume in a different thread*/
/* fun(); assume in a different thread*/
}
we lack the specification for the (block) variable with static storage duration in a similar manner as [class.static.data] p1 did for the static data member. The approach of [class.static.data] p1 is that:
If a static data member is declared thread_local there is one copy of the member per thread. If a static data member is not declared thread_local there is one copy of the data member that is shared by all the objects of the class.
The second sentence can imply that we only have one concrete object or reference associated with the static data member regardless of how many threads refers to it.
Don't we need a similar rule for other kinds of variables with static storage duration, non-normative, such as the following:
There is only one object or reference associated with the variable with static storage duration at any time.
Contributor guide
No contributing guide indexed for this repository
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
Read the example and [class.static.data] p1, then compare its wording with the rules for block variables with static storage duration. Determine whether the draft needs a similar clarification about the number of associated objects or references across threads, and document the resulting standards wording or rationale.
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
- Mostly clear
- Newbie friendliness
- 35/100