参考资料
Channel 发送和接收元素的本质是什么?
282 字
|
1 分钟
channel 在什么情况下会引起资源泄漏
Channel 可能会引发 goroutine 泄漏。
125 字
|
1 分钟
数据结构
底层数据结构需要看源码,版本为 go 1.9.2:
414 字
|
2 分钟
停止信号
Channel 和 goroutine 的结合是 Go 并发编程的大杀器。而 Channel 的实际应用也经常让人眼前一亮,通过与 select,cancel,timer 等结合,它能实现各种各样的功能。接下来,我们就要梳理一下 channel 的应用。
747 字
|
4 分钟
什么是 CSP
> Do not communicate by sharing memory; instead, share memory by communicating.
724 字
|
4 分钟
源码分析
我们先来看一下接收相关的源码。在清楚了接收的具体过程之后,再根据一个实际的例子来具体研究。
2066 字
|
10 分钟
从一个关闭的 channel 仍然能读出数据吗
从一个有缓冲的 channel 里读数据,当 channel 被关闭,依然能读出有效值。只有当返回的 ok 为 false 时,读出的数据才是无效的。
146 字
|
1 分钟
关于 channel 的 happened-before 有哪些
> In computer science, the happened-before relation (denoted: ->) is a relation between the result of two events, such that if one event should happen
1032 字
|
5 分钟