## Happen Before

When a value is sent on an unbuffered channel, the receipt of the value happens before the reawakening of the sending goroutine.

when we say x happens before y, … we mean that it is guaranteed to do so and that all its prior effects, such as updates to variables, are complete and that you may rely on them.

## Lock/Mutex

possible to lock a mutex that’s already locked

## Coherence?

In the absence of explicit synchronization using a channel or mutex, there is no guarantee that events are seen in the same order by all goroutines.

IRIW例子想要看到的最终情况就是，是否可能a == 1 ∧ b == 2 ∧ c == 2 ∧ d == 1. 即在T3和T4的眼中，x的更新顺序是不一样的。例子很极端，普通代码中基本用不到，但是对于完整了解整个memory model的定义/实现是很有意义的。

## How Go Reacts

Whenever possible, confine variables to a single goroutine; for all other variables, use mutual exclusion.

Go自己也提供了一个race detector. 那么看来，他们显然也提供了DRF guarantee, 即对于data-race-free的program, 可以忽略上边一大串幺蛾子，想象成atomic interleaving (sequential consistency) 就足够了，足以考虑到所有的情况了。

However, it can only detect race conditions that occur during a run; it cannot prove that none will ever occur.