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

Channel Size is One or None #53

Open
wangzhione opened this issue Jul 4, 2022 · 0 comments
Open

Channel Size is One or None #53

wangzhione opened this issue Jul 4, 2022 · 0 comments

Comments

@wangzhione
Copy link

Channel Size is One or None

Channels should usually have a size of one or be unbuffered. By default, channels are unbuffered and have a size of zero. Any other size must be subject to a high level of scrutiny. Consider how the size is determined, what prevents the channel from filling up under load and blocking writers, and what happens when this occurs.

推荐用机器翻译的非常好理解,人工翻译补充的语气词画蛇添足,让人误解甚至是错误。这个规范更多是提醒,慎重和建议


百度翻译

通道大小为一或无

通道通常应具有一个或无缓冲的大小。默认情况下,通道是无缓冲的,大小为零。任何其他尺寸都必须经过高度审查。考虑大小是如何确定的,是什么阻止通道在负载下填满并阻塞写入程序,以及发生这种情况时会发生什么。


谷歌翻译

通道大小为一或无

通道的大小通常应为 1 或无缓冲。默认情况下,通道是无缓冲的,大小为零。任何其他尺寸都必须经过严格审查。考虑如何确定大小,防止通道在负载和阻塞写入器下填满的原因,以及发生这种情况时会发生什么。


Channel 的 size 要么是 1,要么是无缓冲的

channel 通常 size 应为 1 或是无缓冲的。默认情况下,channel 是无缓冲的,其 size 为零。任何其他尺寸都必须经过严格的审查。我们需要考虑如何确定大小,考虑是什么阻止了 channel 在高负载下和阻塞写时的写入,以及当这种情况发生时系统逻辑有哪些变化。(翻译解释:按照原文意思是需要界定通道边界,竞态条件,以及逻辑上下文梳理)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant