閱讀220 返回首頁    go 阿裏雲 go 技術社區[雲棲]


Happens-before

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 call to 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 isInterrupted or interrupted).

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

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

最後更新:2017-06-14 09:31:33

  上一篇:go  CCAI 講師專訪 | 機器學習奠基人Thomas Dietterich:人類將如何受到AI威脅
  下一篇:go  Flume監聽文件夾中的文件變化,並把文件下沉到hdfs