<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《也谈goroutine调度器》的评论</title>
	<atom:link href="http://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Wed, 25 Mar 2026 09:21:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：affe</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7507</link>
		<dc:creator>affe</dc:creator>
		<pubDate>Sat, 10 Oct 2020 07:03:21 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7507</guid>
		<description>”如果G被阻塞在某个system call操作上，那么不光G会阻塞，执行该G的M也会解绑P(实质是被sysmon抢走了)，与G一起进入sleep状态“ 感觉M不是进入sleep状态（而是blocked 状态，等待系统调用完成) 因为好像用户态线程没有sleep这个状态，而且如果调用blocking syscall 的话，M应当处于blocked的状态。</description>
		<content:encoded><![CDATA[<p>”如果G被阻塞在某个system call操作上，那么不光G会阻塞，执行该G的M也会解绑P(实质是被sysmon抢走了)，与G一起进入sleep状态“ 感觉M不是进入sleep状态（而是blocked 状态，等待系统调用完成) 因为好像用户态线程没有sleep这个状态，而且如果调用blocking syscall 的话，M应当处于blocked的状态。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7441</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Tue, 21 Apr 2020 01:15:47 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7441</guid>
		<description>why从GM到GPM？最权威的应该是GPM调度器设计和实现者的设计文档：https://docs.google.com/document/d/1TTj4T2JO42uD5ID9e89oa0sLKhJYD0Y_kqxDv3I3XMw/edit 。你也可以看看我翻译的这篇文章：《图解Go运行时调度器》- https://tonybai.com/2020/03/21/illustrated-tales-of-go-runtime-scheduler/ 从goroutine调度的设计视角去分析为什么会有GM，为什么会演化为GPM，解决的是什么问题。</description>
		<content:encoded><![CDATA[<p>why从GM到GPM？最权威的应该是GPM调度器设计和实现者的设计文档：https://docs.google.com/document/d/1TTj4T2JO42uD5ID9e89oa0sLKhJYD0Y_kqxDv3I3XMw/edit 。你也可以看看我翻译的这篇文章：《图解Go运行时调度器》- <a href="https://tonybai.com/2020/03/21/illustrated-tales-of-go-runtime-scheduler/" rel="nofollow">https://tonybai.com/2020/03/21/illustrated-tales-of-go-runtime-scheduler/</a> 从goroutine调度的设计视角去分析为什么会有GM，为什么会演化为GPM，解决的是什么问题。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：crazycn110</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7440</link>
		<dc:creator>crazycn110</dc:creator>
		<pubDate>Sat, 18 Apr 2020 16:30:30 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7440</guid>
		<description>GM为什么不如GPM，没有太理解。面试时候，还被问到了，直接就栽。</description>
		<content:encoded><![CDATA[<p>GM为什么不如GPM，没有太理解。面试时候，还被问到了，直接就栽。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：瓦力</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7421</link>
		<dc:creator>瓦力</dc:creator>
		<pubDate>Sat, 07 Mar 2020 15:12:59 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7421</guid>
		<description>看的时候我也有这个疑问，难不成thread只管创建不管销毁嘛，搜了下后貌似对于thread的管理的确没有太多限制。这里有关于这个问题的讨论：
https://github.com/golang/go/issues/4056</description>
		<content:encoded><![CDATA[<p>看的时候我也有这个疑问，难不成thread只管创建不管销毁嘛，搜了下后貌似对于thread的管理的确没有太多限制。这里有关于这个问题的讨论：<br />
<a href="https://github.com/golang/go/issues/4056" rel="nofollow">https://github.com/golang/go/issues/4056</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：lostpg</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7411</link>
		<dc:creator>lostpg</dc:creator>
		<pubDate>Sun, 05 Jan 2020 09:43:21 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7411</guid>
		<description>请问 G 的抢占调度那部分，
「可以看出，如果一个 G 任务运行 10ms，sysmon 就会认为其运行时间太久而发出抢占式调度的请求。一旦 G 的抢占标志位被设为 true，那么待这个 G 下一次调用函数或方法时，runtime 便可以将 G 抢占，并移出运行状态，放入 P 的 local runq 中，等待下一次被调度。」
是怎么由代码分析得到将被抢占调度的 G「放入 P 的 local runq 中，等待下一次被调度 」。

另：https://wudaijun.com/2018/01/go-scheduler/ 一文认为， go sched 把被抢占调度的 G 放入了 global runq 中。</description>
		<content:encoded><![CDATA[<p>请问 G 的抢占调度那部分，<br />
「可以看出，如果一个 G 任务运行 10ms，sysmon 就会认为其运行时间太久而发出抢占式调度的请求。一旦 G 的抢占标志位被设为 true，那么待这个 G 下一次调用函数或方法时，runtime 便可以将 G 抢占，并移出运行状态，放入 P 的 local runq 中，等待下一次被调度。」<br />
是怎么由代码分析得到将被抢占调度的 G「放入 P 的 local runq 中，等待下一次被调度 」。</p>
<p>另：https://wudaijun.com/2018/01/go-scheduler/ 一文认为， go sched 把被抢占调度的 G 放入了 global runq 中。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Enzo</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7375</link>
		<dc:creator>Enzo</dc:creator>
		<pubDate>Wed, 10 Jul 2019 08:23:11 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7375</guid>
		<description>详细，透彻，学习了</description>
		<content:encoded><![CDATA[<p>详细，透彻，学习了</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Mark</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7372</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 20 Jun 2019 11:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7372</guid>
		<description>好文章，感谢分享</description>
		<content:encoded><![CDATA[<p>好文章，感谢分享</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7339</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Thu, 28 Feb 2019 12:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7339</guid>
		<description>M对应线程。线程的创建和销毁的代价远高于goroutine。因此一旦thread创建，runtime不会轻易销毁它。后续没需要M时，会首先从idle thread中挑选一个。如果idle threads pool中没有idle thread,则会创建一个新的thread。如果非要求甚解（m何时被销毁），还是挖源码吧:)。</description>
		<content:encoded><![CDATA[<p>M对应线程。线程的创建和销毁的代价远高于goroutine。因此一旦thread创建，runtime不会轻易销毁它。后续没需要M时，会首先从idle thread中挑选一个。如果idle threads pool中没有idle thread,则会创建一个新的thread。如果非要求甚解（m何时被销毁），还是挖源码吧:)。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：yun-mu</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7336</link>
		<dc:creator>yun-mu</dc:creator>
		<pubDate>Wed, 27 Feb 2019 02:55:50 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7336</guid>
		<description>请问M什么时候销毁呢，我只看到M被创建和sleep，M的生命周期是什么？</description>
		<content:encoded><![CDATA[<p>请问M什么时候销毁呢，我只看到M被创建和sleep，M的生命周期是什么？</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2017/06/23/an-intro-about-goroutine-scheduler/#comment-7057</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Mon, 25 Dec 2017 12:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=2342#comment-7057</guid>
		<description>嗯，是block on syscall的状态。这里本想表达的也是这个意思。只是用了一个广义的“sleep”，可能不是那么恰当:(。</description>
		<content:encoded><![CDATA[<p>嗯，是block on syscall的状态。这里本想表达的也是这个意思。只是用了一个广义的“sleep”，可能不是那么恰当:(。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
