首页 > 移动平台 > 详细

happen-before原则

时间:2020-01-05 11:51:28      阅读:86      评论:0      收藏:0      [点我收藏+]

 

单线程happen-before原则:      在同一个线程中,书写在前面的操作happen-before后面的操作。

锁的happen-before原则:          同一个锁的unlock操作happen-before此锁的lock操作。

volatile的happen-before原则:  对一个volatile变量的写操作happen-before对此变量的任意操作(当然也包括写操作了)。

happen-before的传递性原则:   如果A操作 happen-before B操作,B操作happen-before C操作,那么A操作happen-before C操作。

线程启动的happen-before原则:同一个线程的start方法happen-before此线程的其它方法。

线程中断的happen-before原则:对线程interrupt方法的调用happen-before被中断线程的检测到中断发送的代码。

线程终结的happen-before原则:线程中的所有操作都happen-before线程的终止检测。

对象创建的happen-before原则:一个对象的初始化完成先于他的finalize方法调用。

happen-before原则

原文:https://www.cnblogs.com/yrjns/p/12151733.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!