<p>I heard that many times, is it true and if it's the case what's the reason and also how to avoid that in our code?</p>
<p>Thank you,</p>
<hr/>**评论:**<br/><br/>TheMerovius: <pre><p>The issue you might be referring to is leaking goroutines, i.e. goroutines that are blocked on a communication that can never succeed (for example they try to write to a channel whose reading end fell out of scope). And yes, if that happens, it's an issue. The issue is basically what a memory leak is in the C/Java/Python world. It's the one thing that makes writing concurrent software in go tricky-ish. Though it's still far less likely than just a memory leak.</p></pre>robertmeta: <pre><blockquote>
<p>I heard that many times</p>
</blockquote>
<p>Consider anyplace that says that a "poor source" for Go knowledge.</p>
<blockquote>
<p>is it true</p>
</blockquote>
<p>Not even a little bit. </p></pre>yimmy149: <pre><p>I have a Go process with 252 days of up-time, it has several long running go routines, no problems.</p></pre>SportingSnow21: <pre><p>There's a "perfect storm" mix that can create issues:</p>
<ul>
<li>Multiple long-running goroutines</li>
<li>Without any blocking calls (I/O, channel, syscalls, function calls in general)</li>
<li>Running on a small number of cores </li>
<li>Generating lots of garbage</li>
</ul>
<p>Combined, this will mess with the runtime (scheduler and GC) to cause rough performance. These situations are rare and usually are a result of terrible design and no refactoring. It's, more-or-less, a subset of the "bad code is bad and you should feel bad" lemma.</p></pre>_nefario_: <pre><p>no. </p>
<p>i don't know where you heard this many times, because i've been reading up on go intensely for several months and i haven't heard this even once. i even work with people who would love nothing more than to shit on go, but even they haven't mentioned anything about this.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传