mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 22:06:51 +08:00
优化14.2翻译 (#721)
This commit is contained in:
@@ -233,7 +233,7 @@ buf 是通道可以同时容纳的元素(这里是 string)个数
|
||||
- value == 0 -> synchronous, unbuffered (阻塞)
|
||||
- value > 0 -> asynchronous, buffered(非阻塞)取决于value元素
|
||||
|
||||
若使用通道的缓冲,你的程序会在“请求”激增的时候表现更好:更具弹性,专业术语叫:更具有伸缩性(scalable)。要在首要位置使用无缓冲通道来设计算法,只在不确定的情况下使用缓冲。
|
||||
若使用通道的缓冲,你的程序会在“请求”激增的时候表现更好:更具弹性,专业术语叫:更具有伸缩性(scalable)。在设计算法时首先考虑使用无缓冲通道,只在不确定的情况下使用缓冲。
|
||||
|
||||
练习 14.3:[channel_buffer.go](exercises/chapter_14/channel_buffer.go):给 [channel_block3.go](exercises/chapter_14/channel_block3.go) 的通道增加缓冲并观察输出有何不同。
|
||||
|
||||
|
Reference in New Issue
Block a user