itwanger / itwanger/toBeBetterJavaer
面渣JUC #_28 勘误
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
原文:
synchronized 通过 JVM 指令 monitorenter 和 monitorexit,来确保加锁代码块内的指令不会被重排。
错误点:
synchronized 不禁止内部重排,而是通过 monitorenter / monitorexit 在进入和退出临界区时引入内存屏障,防止跨锁边界的指令重排。
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
Locate the section titled “面渣JUC #_28” in the repository documentation and compare its synchronized explanation with the correction in this issue. Update the wording to describe monitorenter and monitorexit as memory barriers at the critical-section boundaries, then verify that the corrected explanation is accurate and readable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100