itwanger / itwanger/toBeBetterJavaer

面渣JUC #_28 勘误

Open Beginner friendly
#190 0 comments 0 reactions 0 assignees View on GitHub

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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.