Skip to content

Commit 7c8d771

Browse files
committed
add qrcode
1 parent 2fbca7d commit 7c8d771

28 files changed

+64
-18
lines changed

Diff for: assembly.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -999,11 +999,5 @@ go compile -S:
999999
参考资料[4]需要特别注意,在该 slide 中给出的 callee stack frame 中把 caller 的 return address 也包含进去了,个人认为不是很合适。
10001000
10011001
1002+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">
10021003
1003-
1004-
<!--stackedit_data:
1005-
eyJoaXN0b3J5IjpbMTIzMjkyMzE1MSwtMjY3MTA3MzkxLDEyMz
1006-
I5MjMxNTEsLTg4Mjc1MTcwNiwtMTc0OTAxODUyMiwtMzQ4MTA0
1007-
NjIzLDIwODQwNjM3MjAsLTE1NTYyODU0NDAsMTI2MTcwMTYyMy
1008-
w3NTI0MDk2NTUsMTg4NDQ5NTE5MF19
1009-
-->

Diff for: atomic.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -359,4 +359,6 @@ TEXT runtime∕internal∕atomic·Store(SB), NOSPLIT, $0-12
359359
MOVL val+8(FP), AX
360360
XCHGL AX, 0(BX) // 交换指令
361361
RET
362-
```
362+
```
363+
364+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: bootstrap.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -518,4 +518,6 @@ func main() {
518518
<!--stackedit_data:
519519
eyJoaXN0b3J5IjpbOTA1MjAxMjAyLC0xNDUzNjA2MjEwLDkwNT
520520
IwMTIwMiwtMTQ1MzYwNjIxMCwtNTk2NzUzMDMxXX0=
521-
-->
521+
-->
522+
523+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: channel.md

+3
Original file line numberDiff line numberDiff line change
@@ -705,3 +705,6 @@ func closechan(c *hchan) {
705705
Q: 如果有多个channel同时唤醒同一个goroutine,这个并发控制是怎么做的?
706706

707707
Q: 为什么向 channel 发数据的时候,会直接把数据从一个 goroutine 的栈拷贝到另一个 goroutine 的栈?
708+
709+
710+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: context.md

+2
Original file line numberDiff line numberDiff line change
@@ -566,3 +566,5 @@ func main() {
566566
# 总结
567567

568568
ctx 的结构显然是根据代码的执行模型来设计的,虽然设计得比较巧妙,但因为将取消和上下文携带功能混合在一起,在一些情况下还是会给我们埋些比较隐蔽的坑。使用时需要多多注意。
569+
570+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: defer.md

+3
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,6 @@ A: deferproc 和 deferreturn 是成对出现的,对于编译器的实现来说
160160

161161
https://ieevee.com/tech/2017/11/23/go-panic.html
162162

163+
164+
165+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: futex.md

+3
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,6 @@ http://blog.sina.com.cn/s/blog_e59371cc0102v29b.html
235235
https://www.jianshu.com/p/570a61f08e27
236236

237237
https://eli.thegreenplace.net/2018/basics-of-futexes/
238+
239+
240+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: gc.md

+2
Original file line numberDiff line numberDiff line change
@@ -742,3 +742,5 @@ gc时间,stw时间和响应延迟之间是什么关系
742742

743743
宏观来看gc划分为多少个阶段
744744

745+
746+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: gc_write_barrier.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
TODO
44

5+

Diff for: generics.md

+2
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ cat source.go | genny gen "Something=string"
4040

4141
没有官方的泛型支持,社区怎么搞都是邪道。2021 年 1 月,官方的方案已经基本上成型,并释出了 [draft design](https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md)
4242

43+
44+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: goroutine.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
> Written with [StackEdit](https://stackedit.io/).
88
<!--stackedit_data:
99
eyJoaXN0b3J5IjpbNjQ5NDIwMDBdfQ==
10-
-->
10+
-->
11+
12+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: interface.md

+2
Original file line numberDiff line numberDiff line change
@@ -543,3 +543,5 @@ go.itab.*os.File,io.Writer SRODATA dupok size=32
543543

544544
// 下面就是正常流程了
545545
```
546+
547+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: io.md

+2
Original file line numberDiff line numberDiff line change
@@ -722,3 +722,5 @@ func Splice(dst, src *FD, remain int64) (written int64, handled bool, sc string,
722722

723723
- https://go-review.googlesource.com/c/go/+/271537/
724724
- https://zhuanlan.zhihu.com/p/308054212
725+
726+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: lockfree.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# lock free programming in Go
22

33
# 参考资料
4-
https://docs.google.com/presentation/d/1wuNNW-g6v8qizIc_IxAGZTj-49TODKF0TYddTA1VDUo/mobilepresent?slide=id.p
4+
https://docs.google.com/presentation/d/1wuNNW-g6v8qizIc_IxAGZTj-49TODKF0TYddTA1VDUo/mobilepresent?slide=id.p
5+
6+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: map.md

+2
Original file line numberDiff line numberDiff line change
@@ -1267,3 +1267,5 @@ func (h *hmap) incrnoverflow() {
12671267
}
12681268
}
12691269
```
1270+
1271+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: memory.md

+3
Original file line numberDiff line numberDiff line change
@@ -1396,3 +1396,6 @@ func (p *notInHeap) add(bytes uintptr) *notInHeap {
13961396
### 堆外内存用法
13971397

13981398
嗯,堆外内存只是 runtime 自己玩的东西,用户态是使用不了的,属于 runtime 专用的 directive。
1399+
1400+
1401+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: memory_barrier.md

+2
Original file line numberDiff line numberDiff line change
@@ -569,3 +569,5 @@ https://stackoverflow.com/questions/29880015/lock-prefix-vs-mesi-protocol
569569
https://github.com/torvalds/linux/blob/master/Documentation/memory-barriers.txt
570570

571571
http://www.overbyte.com.au/misc/Lesson3/CacheFun.html
572+
573+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: netpoll.md

+2
Original file line numberDiff line numberDiff line change
@@ -1355,3 +1355,5 @@ func poll_runtime_pollUnblock(pd *pollDesc) {
13551355
}
13561356
}
13571357
```
1358+
1359+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: panic.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,6 @@ func main() {
295295
defer panic(2)
296296
panic(1)
297297
}
298-
```
298+
```
299+
300+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: pprof.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -771,5 +771,8 @@ runtime 自带的 pprof 已经在数据采集的准确性, 覆盖率, 压力等
771771
#开源项目 pprof 参考
772772
[nsq](https://github.com/nsqio/nsq/blob/v1.2.0/nsqd/http.go#L78-L88)
773773
[etcd](https://github.com/etcd-io/etcd/blob/release-3.4/pkg/debugutil/pprof.go#L23) 采用的是[配置式](https://github.com/etcd-io/etcd/blob/release-3.4/etcd.conf.yml.sample#L76)选择是否开启
774+
774775
# 参考资料
775-
https://go-review.googlesource.com/c/go/+/299671
776+
https://go-review.googlesource.com/c/go/+/299671
777+
778+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: scheduler.md

+1
Original file line numberDiff line numberDiff line change
@@ -2348,3 +2348,4 @@ gcMarkDone --> forEachP
23482348

23492349
当然,这里 entersyscall 和 entersyscallblock 比较特殊,虽然这俩函数的实现中有设置抢占标记,但实际上这两段逻辑是不会被走到的。因为 syscall 执行时是在 m 的 g0 栈上,如果在执行时被抢占,那么会直接 throw,而无法恢复。
23502350

2351+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: select.md

+2
Original file line numberDiff line numberDiff line change
@@ -826,3 +826,5 @@ sclose:
826826
Q: 如果select多个channel,有一个channel触发了,其他channel的waitlist需要不要主动去除?还是一直在那等着?
827827

828828
A: waitlist 的出列是由 `func (q *waitq) dequeue() *sudog` 函数控制的,每个 sudog 携带了一个 `selectDone` 标志位,通过 `cas` 操作在每次 `dequeue` 的时候「惰性」去除队列中无效的元素
829+
830+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: semaphore.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -735,4 +735,6 @@ func notifyListCheck(sz uintptr) {
735735
func sync_nanotime() int64 {
736736
return nanotime()
737737
}
738-
```
738+
```
739+
740+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: signal.md

-3
This file was deleted.

Diff for: slice.md

+2
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,5 @@ func main() {
338338
sh.Data = (uintptr)(unsafe.Pointer(&b[1]))
339339
sh.Len = bh.Len - 1
340340
```
341+
342+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: sync.md

+2
Original file line numberDiff line numberDiff line change
@@ -1027,3 +1027,5 @@ Q: 既然被选中了唤醒的那个G,说明这个G就是一定要退出lock
10271027

10281028
A:
10291029

1030+
1031+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: syscall.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -768,4 +768,6 @@ func entersyscall_gcwait() {
768768

769769
3. https://mzh.io/golang-arm64-vdso
770770

771-
4. https://blog.csdn.net/luozhaotian/article/details/79609077
771+
4. https://blog.csdn.net/luozhaotian/article/details/79609077
772+
773+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

Diff for: timer.md

+2
Original file line numberDiff line numberDiff line change
@@ -779,3 +779,5 @@ func (t *Timer) Reset(d Duration) bool {
779779
## 最后
780780

781781
本篇内容主要是讲 Go 的定时器实现,工业界的定时器实现并不只有一种。如果你还想知道其它系统,比如 nginx 里是怎么实现定时器的,可以参考[这一篇](https://www.jianshu.com/p/427dfe8ad3c0)
782+
783+
<img width="330px" src="https://xargin.com/content/images/2021/05/wechat.png">

0 commit comments

Comments
 (0)