Skip to content
New issue

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

【翻译完成】20200711 Go: How Are Deadlocks Triggered? #1790

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

alandtsang
Copy link
Contributor

@polaris1119 polaris1119 self-requested a review August 10, 2020 15:24
Copy link
Member

@polaris1119 polaris1119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

很棒,一个小点,我 merge 后修改哈


每当线程空闲时,就会通知检测器。调试的每一行显示空闲线程的递增数量。当空闲线程数等于活动线程数减去系统线程数时,就会发生死锁。在本例中,我们有三个空闲线程和三个活动线程(四个线程减去系统线程)。由于没有活动线程能够解除阻塞空闲线程,因此存在死锁情况。

但是,这种行为有一些限制。实际上,任何旋转的 goroutine 都会使死锁检测器失效,因为线程将保持活动状态。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

任何旋转的 -> 任何自旋的

@polaris1119 polaris1119 merged commit 067685f into studygolang:master Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants