当前位置:网站首页>详解JMM
详解JMM
2022-07-01 21:43:00 【键盘歌唱家】
一、计算机硬件存储体系
CPU的运行并不是直接操作内存而是先把内存里边的数据读到缓存,而内存的读和写操作的时候就会造成不一致的问题。JVM规范中试图定义一种Java内存模型(java Memory Model,简称JMM)来屏蔽掉各种硬件和操作系统的内存访问差异,以实现让Java程序在各种平台下都能达到一致的内存访问效果。

二、简介
1.JMM简介
JMM(Java内存模型Java Memory Model,简称JMM)本身是一种抽象的概念并不真实存在它仅仅描述的是一组约定或规范,通过这组规范定义了程序中(尤其是多线程)各个变量的读写访问方式并决定一个线程对共享变量的写入何时以及如何变成对另一个线程可见,关键技术点都是围绕多线程的原子性、可见性和有序性展开的。
原则:JMM的关键技术点都是围绕多线程的原子性、可见性和有序性展开的。作用如下:
1.通过JMM来实现线程和主内存之间的抽象关系。
2.屏蔽各个硬件平台和操作系统的内存访问差异以实现让Java程序在各种平台下都能达到一致的内存访问效果。
2.缓存行的概念
一个多核cpu的每个核都自带一二级缓存,所有核都共享一个三级缓存。当把主内存的数据写入缓存时,也会顺便将附近的数据也写进去。这个写入的范围称为缓存行(大小64字节&#
边栏推荐
- 【MySQL】explain的基本使用以及各列的作用
- Electron学习(三)之简单交互操作
- String类型转换BigDecimal、Date类型
- 一次调试去了解redis集群的slot机制
- [live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
- Spark interview questions
- Do you want to make up for the suspended examination in the first half of the year? Including ten examinations for supervision engineers, architects, etc
- 使用闭包实现点击按钮切换 toggle
- Introduction à l'ingénierie logicielle (sixième édition) notes d'examen de Zhang haifan
- pytest合集(2)— pytest运行方式
猜你喜欢

首席信息官对高绩效IT团队定义的探讨和分析

基于K-means的用户画像聚类模型
Design and practice of new generation cloud native database

js如何获取集合对象中某元素列表
![[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!](/img/27/4bd0de716f5cb360d54f140dc8e9c1.png)
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!

Spark interview questions

AIDL基本使用

基于LSTM模型实现新闻分类

What is the difference between PMP and NPDP?
![[deep learning] use deep learning to monitor your girlfriend's wechat chat?](/img/03/ecf50eacc91c0633b0d9689cdad2c2.png)
[deep learning] use deep learning to monitor your girlfriend's wechat chat?
随机推荐
Microsoft, Columbia University | Godel: large scale pre training of goal oriented dialogue
《QTreeView+QAbstractItemModel自定义模型》:系列教程之三[通俗易懂]
小 P 周刊 Vol.11
PHP reflective XSS, reflective XSS test and repair
Pytest Collection (2) - mode de fonctionnement pytest
【MySQL】索引的创建、查看和删除
News classification based on LSTM model
A debugging to understand the slot mechanism of redis cluster
Little p weekly Vol.11
企业架构与项目管理的关联和区别
Basic operation of binary tree
【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程
ngnix基础知识
An operation tool used by we media professionals who earn 1w+ a month
mysql 学习笔记-优化之SQL优化
Business visualization - make your flowchart'run'up
从MLPerf谈起:如何引领AI加速器的下一波浪潮
Airserver mobile phone third-party screen projection computer software
MIT|256KB 内存下的设备上训练