TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: A pure reference counting GC in Go

57 点作者 sendilkumarn超过 5 年前

5 条评论

maxgraey超过 5 年前
By the way concurrent algorithm described in paper has couple of bugs that were found and corrected by dcodeIO during prototyping this GC&#x2F;RC for AssemblyScript:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dcodeIO&#x2F;purerc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dcodeIO&#x2F;purerc</a>
评论 #22058613 未加载
gwbas1c超过 5 年前
Just curious: Does this do anything to avoid the need to explicitly close resources in a garbage collected environment? (IE, the Disposable pattern in C# &#x2F; .Net)<p>Specifically, when I work in a reference-counted environment, if an object has a resource, like an open file, or a socket, I don&#x27;t need to do anything special when I&#x27;m done with that object. The reference count predictably drops when I&#x27;m done with the object, and its destructor cleans up its resources.<p>In contrast, because garbage collection is non-deterministic, in a garbage collected environment, I have to use extra special care when an object uses a resource (file, socket, ect,) that needs to be released at a predictable moment.<p>Because: If, in a garbage collected environment, the rule of thumb is to &quot;make sure you don&#x27;t have circular references to your resources, (files, sockets, ect,)&quot; this would dramatically simplify resource (not memory) management!
评论 #22055570 未加载
ckok超过 5 年前
Quite cool. But I miss the part where you can actually use the objects themselves to store something in. What&#x27;s your goal here? To have a real usable gc, becuase if so, it should probably allocate outside the Go heap, and directly from the OS? Also the fields should probably be packed:<p><pre><code> Name string Rc int Crc int Color string Buffered bool Children []*Object Freed bool isAcyclic bool </code></pre> as those seem to have quite a bit of overhead for an object.
评论 #22052497 未加载
icholy超过 5 年前
The code doesn&#x27;t build and is extremely racy.<p>edit: I fixed the import cycles and got it to build, but now the tests don&#x27;t pass. The more of this code I read ... the worse it gets. Why is this on top of HN?
kstenerud超过 5 年前
This is quite cool. I love seeing new research into reference counting systems since they seem to have fallen out of favor vs mark&#x2F;sweep and such (ARC notwithstanding).
评论 #22052494 未加载