57

JDK Unsafe 源码完全注释-java架构师1的博客

 5 years ago
source link: https://blog.51cto.com/13981400/2372578
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.
并发作为Java中非常重要的一部分,其内部大量使用了Unsafe类,它为java.util.concurrent包中的类提供了底层支持。然而Unsafe并不是JDK的标准,它是Sun的内部实现,存在于sun.misc包中,在Oracle发行的JDK中并不包含其源代码。Unsafe提供两个功能:绕过JVM直接修改内存(对象)使用硬件CPU指令实现CAS原子操作虽然我们在一般的并发编程中不会直接用到U

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK