volatile保证原子性

Open
#143 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
documentation

Research direction

Start with chapter eight, “volatile,” and review the two attached screenshots. The issue asks for a conceptual clarification of atomicity, but names no source file, test, or concrete documentation change; the expected wording and completion criteria would need to be agreed before work can begin.

Written by the indexing model from the issue text.

Description

章节
第八章 volatile

相关截图或文字
屏幕截图 2024-05-11 232638
image

疑问
对单个volatile修饰的变量的写操作,第一步:JMM会先将这个变量写到线程本地缓存中,第二步:再将这个变量刷新到主存中。这是两步,为什么说volatile能保证对单个volatile变量的读/写具有原子性???

Dominant language
Java
Stars
4.6k
Forks
719
PR merge metrics
No merged PRs in 30d

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.

More from RedSpider1/concurrent

All issues in RedSpider1/concurrent

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.