<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>线程 &#8211; 编程小札 &#8211; CodeShell.io</title>
	<atom:link href="https://codeshell.io/archives/tag/%e7%ba%bf%e7%a8%8b/feed" rel="self" type="application/rss+xml" />
	<link>https://codeshell.io</link>
	<description></description>
	<lastBuildDate>Tue, 08 Jan 2019 10:56:46 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.3.2</generator>

<image>
	<url>https://codeshell.io/wp-content/uploads/2020/06/cropped-code-32x32.png</url>
	<title>线程 &#8211; 编程小札 &#8211; CodeShell.io</title>
	<link>https://codeshell.io</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>进程、线程、协程</title>
		<link>https://codeshell.io/archives/404</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 08 Jan 2019 10:45:20 +0000</pubDate>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[协程]]></category>
		<category><![CDATA[线程]]></category>
		<category><![CDATA[进程]]></category>
		<guid isPermaLink="false">https://blog.lcodelite.com/?p=404</guid>

					<description><![CDATA[参考：http://easyswoole.com/Manual/3.x/Cn/_book/noobCourse/Coroutine.html协程不是进程或线程，...<p class="read-more"><a class="btn btn-default" href="https://codeshell.io/archives/404"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>参考：<a href="http://easyswoole.com/Manual/3.x/Cn/_book/noobCourse/Coroutine.html" target="_blank" rel="noreferrer noopener" aria-label="（在新窗口打开）">http://easyswoole.com/Manual/3.x/Cn/_book/noobCourse/Coroutine.html</a><br>协程不是进程或线程，其执行过程更类似于子例程，或者说不带返回值的函数调用。<br>一个程序可以包含多个协程，可以对比与一个进程包含多个线程，因而下面我们来比较协程和线程。我们知道多个线程相对独立，有自己的上下文，切换受系统控制；而协程也相对独立，有自己的上下文，但是其切换由自己控制，由当前协程切换到其他协程由当前协程来控制。</p>



<figure class="wp-block-image"><img decoding="async" fetchpriority="high" width="620" height="1024" src="https://blog.lcodelite.com/wp-content/uploads/2019/01/Coroutine-620x1024.png" alt="" class="wp-image-405" srcset="https://codeshell.io/wp-content/uploads/2019/01/Coroutine-620x1024.png 620w, https://codeshell.io/wp-content/uploads/2019/01/Coroutine-182x300.png 182w, https://codeshell.io/wp-content/uploads/2019/01/Coroutine.png 725w" sizes="(max-width: 620px) 100vw, 620px" /></figure>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
