We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
まずは単純な例で考えてみる
一貫しているか? → どういうパスを通っても必ずlockされている → 他の関数呼び出しで追いかける必要がなくなる
The text was updated successfully, but these errors were encountered:
Example
package main import "sync" type T1 struct { mu sync.Mutex n int } type T2 struct { mu sync.Mutex value float64 } type T struct { t1 *T1 t2 *T2 } func (t *T) Lock() { t.t1.Lock() t.t2.Lock() } func (t *T) Unlock() { t.t2.Unlock() t.t1.Unlock() } func (t *T) DoCritical() { t.Lock() t.t1.n++ t.t2.value *= 0.2 t.Unlock() } func (t *T) DoCritical2(n int ) { t.Lock() if n == 0 { // t.t2.Unlock() return // missing unlock } t.t1.n = n t.t2.Unlock() if n == 0 { t.t1.Unlock() return } t.t1.Unlock() }
Sorry, something went wrong.
goroutine 1つ1つについて見ていく
高階関数があると、難しくなる CHA? → 変数が値がとり得る値の集合 callgraph 相互依存
fという変数が具体的に取る値、どの関数になるか?を解析 ← これにはcallgraph goroutineの呼び出し時に関数がどのくらい渡されているか?
goroutineの使われ方を調べる
No branches or pull requests
まずは単純な例で考えてみる
一貫しているか? → どういうパスを通っても必ずlockされている → 他の関数呼び出しで追いかける必要がなくなる
The text was updated successfully, but these errors were encountered: