-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.xml
282 lines (221 loc) · 14.4 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Arbus's Little Site</title>
<link>https://arbusz.github.io/</link>
<description>Recent content on Arbus's Little Site</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Sun, 10 May 2020 22:33:10 +0800</lastBuildDate>
<atom:link href="https://arbusz.github.io/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>分布式原理</title>
<link>https://arbusz.github.io/2020/05/%E5%88%86%E5%B8%83%E5%BC%8F%E5%8E%9F%E7%90%86/</link>
<pubDate>Sun, 10 May 2020 22:33:10 +0800</pubDate>
<guid>https://arbusz.github.io/2020/05/%E5%88%86%E5%B8%83%E5%BC%8F%E5%8E%9F%E7%90%86/</guid>
<description><p></p></description>
</item>
<item>
<title>Golang的GC算法</title>
<link>https://arbusz.github.io/2020/04/golang%E7%9A%84gc%E7%AE%97%E6%B3%95/</link>
<pubDate>Sun, 19 Apr 2020 22:31:59 +0800</pubDate>
<guid>https://arbusz.github.io/2020/04/golang%E7%9A%84gc%E7%AE%97%E6%B3%95/</guid>
<description><p></p></description>
</item>
<item>
<title>标记清除算法</title>
<link>https://arbusz.github.io/2020/04/%E6%A0%87%E8%AE%B0%E6%B8%85%E9%99%A4%E7%AE%97%E6%B3%95/</link>
<pubDate>Thu, 16 Apr 2020 22:35:51 +0800</pubDate>
<guid>https://arbusz.github.io/2020/04/%E6%A0%87%E8%AE%B0%E6%B8%85%E9%99%A4%E7%AE%97%E6%B3%95/</guid>
<description><p></p></description>
</item>
<item>
<title>滑动窗口问题</title>
<link>https://arbusz.github.io/2020/03/%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3%E9%97%AE%E9%A2%98/</link>
<pubDate>Sat, 28 Mar 2020 22:36:04 +0800</pubDate>
<guid>https://arbusz.github.io/2020/03/%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3%E9%97%AE%E9%A2%98/</guid>
<description><p></p></description>
</item>
<item>
<title>引用计数算法</title>
<link>https://arbusz.github.io/2020/03/%E5%BC%95%E7%94%A8%E8%AE%A1%E6%95%B0%E7%AE%97%E6%B3%95/</link>
<pubDate>Sun, 08 Mar 2020 22:35:02 +0800</pubDate>
<guid>https://arbusz.github.io/2020/03/%E5%BC%95%E7%94%A8%E8%AE%A1%E6%95%B0%E7%AE%97%E6%B3%95/</guid>
<description><p></p></description>
</item>
<item>
<title>复制收集算法</title>
<link>https://arbusz.github.io/2020/03/%E5%A4%8D%E5%88%B6%E6%94%B6%E9%9B%86%E7%AE%97%E6%B3%95/</link>
<pubDate>Mon, 02 Mar 2020 22:33:33 +0800</pubDate>
<guid>https://arbusz.github.io/2020/03/%E5%A4%8D%E5%88%B6%E6%94%B6%E9%9B%86%E7%AE%97%E6%B3%95/</guid>
<description><p></p></description>
</item>
<item>
<title>GC算法评价标准</title>
<link>https://arbusz.github.io/2020/02/gc%E7%AE%97%E6%B3%95%E8%AF%84%E4%BB%B7%E6%A0%87%E5%87%86/</link>
<pubDate>Mon, 24 Feb 2020 22:31:45 +0800</pubDate>
<guid>https://arbusz.github.io/2020/02/gc%E7%AE%97%E6%B3%95%E8%AF%84%E4%BB%B7%E6%A0%87%E5%87%86/</guid>
<description><p></p></description>
</item>
<item>
<title>GC可达分析</title>
<link>https://arbusz.github.io/2020/02/gc%E5%8F%AF%E8%BE%BE%E5%88%86%E6%9E%90/</link>
<pubDate>Fri, 21 Feb 2020 22:31:32 +0800</pubDate>
<guid>https://arbusz.github.io/2020/02/gc%E5%8F%AF%E8%BE%BE%E5%88%86%E6%9E%90/</guid>
<description><p></p></description>
</item>
<item>
<title>快慢指针</title>
<link>https://arbusz.github.io/2020/02/%E5%BF%AB%E6%85%A2%E6%8C%87%E9%92%88/</link>
<pubDate>Tue, 18 Feb 2020 22:34:21 +0800</pubDate>
<guid>https://arbusz.github.io/2020/02/%E5%BF%AB%E6%85%A2%E6%8C%87%E9%92%88/</guid>
<description><p></p></description>
</item>
<item>
<title>Docker架构简介</title>
<link>https://arbusz.github.io/2019/04/docker%E6%9E%B6%E6%9E%84%E7%AE%80%E4%BB%8B/</link>
<pubDate>Sat, 20 Apr 2019 22:30:34 +0800</pubDate>
<guid>https://arbusz.github.io/2019/04/docker%E6%9E%B6%E6%9E%84%E7%AE%80%E4%BB%8B/</guid>
<description><p></p></description>
</item>
<item>
<title>Golang线程调度</title>
<link>https://arbusz.github.io/2018/12/golang%E7%BA%BF%E7%A8%8B%E8%B0%83%E5%BA%A6/</link>
<pubDate>Fri, 21 Dec 2018 22:32:11 +0800</pubDate>
<guid>https://arbusz.github.io/2018/12/golang%E7%BA%BF%E7%A8%8B%E8%B0%83%E5%BA%A6/</guid>
<description><p></p></description>
</item>
<item>
<title>Haskell函数式编程初探</title>
<link>https://arbusz.github.io/2018/12/haskell%E5%87%BD%E6%95%B0%E5%BC%8F%E7%BC%96%E7%A8%8B%E5%88%9D%E6%8E%A2/</link>
<pubDate>Thu, 06 Dec 2018 16:54:01 +0800</pubDate>
<guid>https://arbusz.github.io/2018/12/haskell%E5%87%BD%E6%95%B0%E5%BC%8F%E7%BC%96%E7%A8%8B%E5%88%9D%E6%8E%A2/</guid>
<description><p></p></description>
</item>
<item>
<title>支持Docker运行的三大基础技术</title>
<link>https://arbusz.github.io/2018/10/%E6%94%AF%E6%8C%81docker%E8%BF%90%E8%A1%8C%E7%9A%84%E4%B8%89%E5%A4%A7%E5%9F%BA%E7%A1%80%E6%8A%80%E6%9C%AF/</link>
<pubDate>Wed, 24 Oct 2018 22:35:30 +0800</pubDate>
<guid>https://arbusz.github.io/2018/10/%E6%94%AF%E6%8C%81docker%E8%BF%90%E8%A1%8C%E7%9A%84%E4%B8%89%E5%A4%A7%E5%9F%BA%E7%A1%80%E6%8A%80%E6%9C%AF/</guid>
<description><p></p></description>
</item>
<item>
<title>Go 超时处理</title>
<link>https://arbusz.github.io/2018/10/go-%E8%B6%85%E6%97%B6%E5%A4%84%E7%90%86/</link>
<pubDate>Sat, 20 Oct 2018 15:43:46 +0800</pubDate>
<guid>https://arbusz.github.io/2018/10/go-%E8%B6%85%E6%97%B6%E5%A4%84%E7%90%86/</guid>
<description><p></p></description>
</item>
<item>
<title>Nmap总结</title>
<link>https://arbusz.github.io/2018/10/nmap%E6%80%BB%E7%BB%93/</link>
<pubDate>Sun, 07 Oct 2018 20:29:14 +0800</pubDate>
<guid>https://arbusz.github.io/2018/10/nmap%E6%80%BB%E7%BB%93/</guid>
<description><p></p></description>
</item>
<item>
<title>Raft协议</title>
<link>https://arbusz.github.io/2018/10/raft%E5%8D%8F%E8%AE%AE/</link>
<pubDate>Sun, 07 Oct 2018 20:29:14 +0800</pubDate>
<guid>https://arbusz.github.io/2018/10/raft%E5%8D%8F%E8%AE%AE/</guid>
<description><p></p></description>
</item>
<item>
<title>马拉车算法</title>
<link>https://arbusz.github.io/2018/10/%E9%A9%AC%E6%8B%89%E8%BD%A6%E7%AE%97%E6%B3%95/</link>
<pubDate>Sun, 07 Oct 2018 20:25:34 +0800</pubDate>
<guid>https://arbusz.github.io/2018/10/%E9%A9%AC%E6%8B%89%E8%BD%A6%E7%AE%97%E6%B3%95/</guid>
<description><p></p></description>
</item>
<item>
<title>Vim的go语言配置</title>
<link>https://arbusz.github.io/2018/09/vim%E7%9A%84go%E8%AF%AD%E8%A8%80%E9%85%8D%E7%BD%AE/</link>
<pubDate>Sun, 02 Sep 2018 17:10:44 +0800</pubDate>
<guid>https://arbusz.github.io/2018/09/vim%E7%9A%84go%E8%AF%AD%E8%A8%80%E9%85%8D%E7%BD%AE/</guid>
<description><p></p></description>
</item>
<item>
<title>分布式协议 Raft</title>
<link>https://arbusz.github.io/2018/09/%E5%88%86%E5%B8%83%E5%BC%8F%E5%8D%8F%E8%AE%AEraft/</link>
<pubDate>Sun, 02 Sep 2018 17:08:32 +0800</pubDate>
<guid>https://arbusz.github.io/2018/09/%E5%88%86%E5%B8%83%E5%BC%8F%E5%8D%8F%E8%AE%AEraft/</guid>
<description><p></p></description>
</item>
<item>
<title>两种主流并发模型</title>
<link>https://arbusz.github.io/2018/09/%E4%B8%A4%E7%A7%8D%E4%B8%BB%E6%B5%81%E5%B9%B6%E5%8F%91%E6%A8%A1%E5%9E%8B/</link>
<pubDate>Sun, 02 Sep 2018 17:02:35 +0800</pubDate>
<guid>https://arbusz.github.io/2018/09/%E4%B8%A4%E7%A7%8D%E4%B8%BB%E6%B5%81%E5%B9%B6%E5%8F%91%E6%A8%A1%E5%9E%8B/</guid>
<description><p></p></description>
</item>
<item>
<title>一个遍历目录的小程序</title>
<link>https://arbusz.github.io/2018/07/%E4%B8%80%E4%B8%AA%E9%81%8D%E5%8E%86%E7%9B%AE%E5%BD%95%E7%9A%84%E5%B0%8F%E7%A8%8B%E5%BA%8F/</link>
<pubDate>Thu, 05 Jul 2018 08:19:34 +0800</pubDate>
<guid>https://arbusz.github.io/2018/07/%E4%B8%80%E4%B8%AA%E9%81%8D%E5%8E%86%E7%9B%AE%E5%BD%95%E7%9A%84%E5%B0%8F%E7%A8%8B%E5%BA%8F/</guid>
<description><p></p></description>
</item>
<item>
<title>Go语言与Prorobuf</title>
<link>https://arbusz.github.io/2018/06/go%E8%AF%AD%E8%A8%80%E4%B8%8Eprorobuf/</link>
<pubDate>Tue, 12 Jun 2018 22:37:11 +0800</pubDate>
<guid>https://arbusz.github.io/2018/06/go%E8%AF%AD%E8%A8%80%E4%B8%8Eprorobuf/</guid>
<description><p></p></description>
</item>
<item>
<title>包含nil指针的接口和nil接口</title>
<link>https://arbusz.github.io/2018/06/%E5%8C%85%E5%90%ABnil%E6%8C%87%E9%92%88%E7%9A%84%E6%8E%A5%E5%8F%A3%E5%92%8Cnil%E6%8E%A5%E5%8F%A3/</link>
<pubDate>Mon, 04 Jun 2018 21:26:20 +0800</pubDate>
<guid>https://arbusz.github.io/2018/06/%E5%8C%85%E5%90%ABnil%E6%8C%87%E9%92%88%E7%9A%84%E6%8E%A5%E5%8F%A3%E5%92%8Cnil%E6%8E%A5%E5%8F%A3/</guid>
<description><p></p></description>
</item>
<item>
<title>Go语言笔记-函数</title>
<link>https://arbusz.github.io/2018/05/go%E8%AF%AD%E8%A8%80%E7%AC%94%E8%AE%B0%E5%87%BD%E6%95%B0/</link>
<pubDate>Sun, 20 May 2018 19:59:36 +0800</pubDate>
<guid>https://arbusz.github.io/2018/05/go%E8%AF%AD%E8%A8%80%E7%AC%94%E8%AE%B0%E5%87%BD%E6%95%B0/</guid>
<description><p></p></description>
</item>
<item>
<title>Go语言笔记-表达式</title>
<link>https://arbusz.github.io/2018/05/go%E8%AF%AD%E8%A8%80%E7%AC%94%E8%AE%B0%E8%A1%A8%E8%BE%BE%E5%BC%8F/</link>
<pubDate>Sun, 20 May 2018 19:45:45 +0800</pubDate>
<guid>https://arbusz.github.io/2018/05/go%E8%AF%AD%E8%A8%80%E7%AC%94%E8%AE%B0%E8%A1%A8%E8%BE%BE%E5%BC%8F/</guid>
<description><p></p></description>
</item>
<item>
<title>Go语言笔记-类型</title>
<link>https://arbusz.github.io/2018/03/go%E8%AF%AD%E8%A8%80%E7%AC%94%E8%AE%B0%E7%B1%BB%E5%9E%8B/</link>
<pubDate>Tue, 27 Mar 2018 19:24:27 +0800</pubDate>
<guid>https://arbusz.github.io/2018/03/go%E8%AF%AD%E8%A8%80%E7%AC%94%E8%AE%B0%E7%B1%BB%E5%9E%8B/</guid>
<description><p></p></description>
</item>
<item>
<title>格式化输入</title>
<link>https://arbusz.github.io/2018/02/%E6%A0%BC%E5%BC%8F%E5%8C%96%E8%BE%93%E5%85%A5/</link>
<pubDate>Tue, 13 Feb 2018 22:36:23 +0800</pubDate>
<guid>https://arbusz.github.io/2018/02/%E6%A0%BC%E5%BC%8F%E5%8C%96%E8%BE%93%E5%85%A5/</guid>
<description><p></p></description>
</item>
<item>
<title>格式化输出</title>
<link>https://arbusz.github.io/2018/02/%E6%A0%BC%E5%BC%8F%E5%8C%96%E8%BE%93%E5%87%BA/</link>
<pubDate>Mon, 12 Feb 2018 22:36:33 +0800</pubDate>
<guid>https://arbusz.github.io/2018/02/%E6%A0%BC%E5%BC%8F%E5%8C%96%E8%BE%93%E5%87%BA/</guid>
<description><p></p></description>
</item>
<item>
<title>协程Coroutines</title>
<link>https://arbusz.github.io/1/01/%E5%8D%8F%E7%A8%8Bcoroutines/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://arbusz.github.io/1/01/%E5%8D%8F%E7%A8%8Bcoroutines/</guid>
<description>协程的概念 对操作系统来说,进程是最小的资源管理单元,线程是最小的执行单元。 对于进程和线程,都是有内核进行调度,有CPU时间片的概念,有多种调度算法。
协程,英文Coroutines,是一种比线程更加轻量级的存在。正如一个进程可以拥有多个线程一样,一个线程也可以有多个协程。 协程不是被操作系统内核所管理,而是完全在用户态执行,换句话说,协程是用户透明的。这样带来的好处就是性能得到了很大的提升,不会像线程切换那样消耗资源。
goroutine和协程的区别 本质上,goroutine就是协程。不同的是,Go在runtime、系统调用等多方面对goroutine调度进行了封装和处理。当遇到长时间执行或进行系统调用时,会主动把当前的goroutine的CPU转让出去,让其他goroutine能被调度和执行,也就是GO从语言层面支持了协程。
在内存消耗方面,每个goroutine默认占用的内存远比C、Java的线程少。 在切换调度开销方面,线程涉及到模式切换(用户态与内核态)、多个寄存器刷新。goroutine只有三个寄存器的值修改(PC/SP/DX)。
协程的底层实现 协程是在应用层模拟线程,他避免了上下文切换的额外消耗,同时兼顾了多线程的优点,简化了高并发程序的复杂性。 实现原理与线程类似,线程a切换到线程b时,需要将线程a的相关执行进度压栈,然后线程b的执行进度出栈,进入线程b的执行序列。协程只不过是在应用层实现了这一点。 协程是基于线程的。内部实现上,维护了一组数据结构和n个线程,真正执行的还是线程。协程执行的代码被扔进一个待执行队列中,由这n个线程从队列中拉出来执行。这就解决了协程的执行问题。那么协程是怎么切换的呢?答案是:golang 对各种 io函数进行了封装,这些封装的函数提供给应用程序使用,而其内部调用了操作系统的异步io函数,当这些异步函数返回busy或bloking时,golang利用这个时机将现有的执行序列压栈,让线程去拉另外一个协程的代码来执行,基本原理就是这样,利用并封装了操作系统的异步函数。 (Go语言运行库封装了异步io,但即使我们通过调整$GOMAXPROCS来充分利用多核CPU并行处理,其效率也不如我们利用io事件驱动设计的、按照事物类型划分好合适比例的线程池,在响应时间上,协作调度是硬伤。)
挖坑:goroutine的详细底层实现和应用
应用</description>
</item>
</channel>
</rss>