09/11/09 02:46:10
はい
えーと・・・・・・ここかな
URLリンク(java.sun.com)
抜粋で
> Synchronization actions induce the synchronized-with relation on actions, defined as follows:
> ・A write to a volatile variable (§8.3.1.4) v synchronizes-with all subsequent reads of v
> by any thread (where subsequent is defined according to the synchronization order).
> If we have two actions x and y, we write hb(x, y) to indicate that x happens-before y.
> ・If x and y are actions of the same thread and x comes before y in program order, then hb(x, y).
> ・If an action x synchronizes-with a following action y, then we also have hb(x, y).
あるスレッド内でvolatileへの書き込みより前に起きることは、
別のスレッド内でそれを読み出した後に起きることよりも前に起きる