# Java内存模型

## 目录

* [Java 内存模型的基础](https://tuonioooo-notebook.gitbook.io/java-concurrent/di-san-zhang-java-nei-cun-mo-xing/java-nei-cun-mo-xing-de-ji-chu)&#x20;
* [重排序](https://tuonioooo-notebook.gitbook.io/java-concurrent/di-san-zhang-java-nei-cun-mo-xing/zhong-pai-xu)&#x20;
* [顺序一致性](https://tuonioooo-notebook.gitbook.io/java-concurrent/di-san-zhang-java-nei-cun-mo-xing/shun-xu-yi-zhi-xing)&#x20;
* [volatile内存语义](https://tuonioooo-notebook.gitbook.io/java-concurrent/di-san-zhang-java-nei-cun-mo-xing/volatilenei-cun-yu-yi)&#x20;
* [锁内存定义](https://tuonioooo-notebook.gitbook.io/java-concurrent/di-san-zhang-java-nei-cun-mo-xing/suo-nei-cun-ding-yi)&#x20;
* [final域内存语义](https://tuonioooo-notebook.gitbook.io/java-concurrent/di-san-zhang-java-nei-cun-mo-xing/finalyu-nei-cun-yu-yi)

Java线程之间的通信对程序员完全透明，内存可见性问题很容易困扰Java程序员，本章将\
揭开Java内存模型神秘的面纱。

本章大致分4部分：

Java内存模型的基础，主要介绍内存模型相\
关的基本概念；

Java内存模型中的顺序一致性，主要介绍重排序与顺序一致性内存模型；

同步\
原语，主要介绍3个同步原语（synchronized、volatile和final）的内存语义及重排序规则在处理器\
中的实现；

Java内存模型的设计，主要介绍Java内存模型的设计原理，及其与处理器内存模型\
和顺序一致性内存模型的关系。

> **注意阅读本章读者用了解的心态去看**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tuonioooo-notebook.gitbook.io/java-concurrent/di-san-zhang-java-nei-cun-mo-xing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
