22

volatile原理技术知识整理

 4 years ago
source link: https://juejin.im/post/5e17a5735188254c0a0409f1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
volatile是一种轻量且在有限的条件下线程安全技术,它保证修饰的变量的可见性和有序性,但非原子性。相对于synchronize高效,而常常跟synchronize配合使用。 一. Java内存模型 这里主要描述的线程,工作内存,主存的变量的读写关系:

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK