源码分析 - Golang
我们先来看一下接收相关的源码。在清楚了接收的具体过程之后,再根据一个实际的例子来具体研究。
2066 字
|
10 分钟
从一个关闭的 channel 仍然能读出数据吗 - Go 原理
从一个有缓冲的 channel 里读数据,当 channel 被关闭,依然能读出有效值。只有当返回的 ok 为 false 时,读出的数据才是无效的。
146 字
|
1 分钟
关于 channel 的 happened-before 有哪些 - Go 原理
> 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 分钟
源码分析 - 向 channel 发送数据的过程是怎样的
发送操作最终转化为 chansend 函数,直接上源码,同样大部分都注释了,可以看懂主流程:
1655 字
|
8 分钟
参考资料 - 如何优雅地关闭 channel
关于 channel 的使用,有几点不方便的地方:
1419 字
|
7 分钟
GC 的认识 - Go 原理
[GC官方源码](https://github.com/golang/go/blob/master/src/runtime/mgc.go)
13961 字
|
70 分钟