• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

littlesuccess

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

Java并发编程实践-16章-Java内存模型

Program order rule.
Each action in a thread happens-before every action in that thread that comes later in the program order.

Monitor lock rule.
An unlock on a monitor lock happens-before every subsequent lock on that same monitor lock.

Volatile variable rule.
A write to a volatile field happens-before every subsequent read of that same field.

Thread start rule.
A callto Thread.start on a thread happens-before every action in the started thread.

Thread termination rule. Any action in a thread happens-before any other thread detects that thread has terminated, either by successfully return from Thread.join or by Thread.isAlive returning
false.

Interruption rule.
A thread calling interrupt on another thread happens-before the interrupted thread detects the interrupt (either by having InterruptedException thrown, or invoking isInter-
rupted or interrupted).

Finalizer rule. The end of a constructor for an object happens-before the start of the ?nalizer for that object.

Transitivity.
If A happens-before B,and B happens-before C, then A happens-before C.

posted on 2011-11-28 17:25  littlesuccess  阅读(218)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3