diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2011-10-06 18:10:14 +0300 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2011-10-06 18:10:14 +0300 |
| commit | 56959158331072ed17801aa539a0d6f28064b511 (patch) | |
| tree | 1420df3557880dd9b7a0bbd343bf3aaedb231b78 /src/pkg/runtime/malloc.goc | |
| parent | 504963e6a466bd0c13c6f36f1ca129602151e598 (diff) | |
| download | go-56959158331072ed17801aa539a0d6f28064b511.tar.xz | |
runtime: fix spurious deadlock reporting
Fixes #2337.
Unfortunate sequence of events is:
1. maxcpu=2, mcpu=1, grunning=1
2. starttheworld creates an extra M:
maxcpu=2, mcpu=2, grunning=1
4. the goroutine calls runtime.GOMAXPROCS(1)
maxcpu=1, mcpu=2, grunning=1
5. since it sees mcpu>maxcpu, it calls gosched()
6. schedule() deschedules the goroutine:
maxcpu=1, mcpu=1, grunning=0
7. schedule() call getnextandunlock() which
fails to pick up the goroutine again,
because canaddcpu() fails, because mcpu==maxcpu
8. then it sees that grunning==0,
reports deadlock and terminates
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5191044
Diffstat (limited to 'src/pkg/runtime/malloc.goc')
0 files changed, 0 insertions, 0 deletions
