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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Introduction to Golang Preemption Mechanisms

109 点作者 lcof10 个月前

6 条评论

__turbobrew__10 个月前
Are there any proposals to make the golang runtime cgroup aware? Last time I checked the go runtime will spawn a OS process for each cpu it can see even if it is running in a cgroup which only allows 1 CPU of usage. On servers with 100+ cores I have seen scheduling time take over 10% of the program runtime.<p>The fix is to inspect the cgroupfs to see how many CPU shares you can utilize and then set gomaxprocs to match that. I think other runtime like Java and .NET do this automatically.<p>It is the same thing with GOMEMLIMIT, I don’t see why the runtime does not inspect cgroupfs and set GOMEMLIMIT to 90% of the cgroup memory limit.
评论 #41219307 未加载
评论 #41219274 未加载
评论 #41223140 未加载
评论 #41220003 未加载
metadat10 个月前
&gt; think about it - what if I suddenly stopped you while taking a dump? It would have been easier to have stopped you before, or after, but not in the middle of it. Not sure about the analogy, but you got it.<p>Gold.
ollien10 个月前
Great post! One question that lingered for me is: what are asynchronous safe-points? The post goes into some detail about their synchronous counterparts
评论 #41222570 未加载
gregors10 个月前
If you&#x27;d like to see a really well done deep dive by the new Golang Tech Lead ( Austin Clements), check this out<p>GopherCon 2020: Austin Clements - Pardon the Interruption: Loop Preemption in Go 1.14<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=1I1WmeSjRSw" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=1I1WmeSjRSw</a>
zbentley10 个月前
Interesting that it’s temporal (according to the article, you have around 10 microseconds before the signal-based preempter kicks in). How bad is performance if the load on the host is so high that double-preempting is common, I wonder? Or am I missing something and that question is not meaningful?
评论 #41218961 未加载
评论 #41224168 未加载
hiyer10 个月前
This is a well-written article, but one thing that wasn&#x27;t clear to me was how the runtime determines that it&#x27;s at a safe point. Can someone shed some light on that?
评论 #41222546 未加载