<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
<channel>
 <title><![CDATA[线程执行顺序]]></title>
 <link><![CDATA[http://aiothome.net/read.php?tid=6629]]></link>
 <description><![CDATA[Latest 20 replies of 线程执行顺序]]></description>
 <copyright><![CDATA[Copyright(C) ]]></copyright>
 <generator><![CDATA[PHPWind Forums by PHPWind Studio]]></generator>
 <lastBuildDate><![CDATA[Sun, 26 Jul 2026 14:47:48 +0000]]></lastBuildDate>
  <image>
 <url><![CDATA[images/rss.gif]]></url>
 <title><![CDATA[PHPWind Board]]></title>
 <link><![CDATA[http://aiothome.net]]></link>
 <description><![CDATA[]]></description>
  </image>
<item>
 <title><![CDATA[]]></title>
 <description><![CDATA[而加上pthread_join(id,NULL);
这句的时候，执行效果是
this is the main thread
this is 0 pthread
this is 1 pthread
this is 2 pthread
this is 3 pthread
this is 4 pthread
this is 5 pthread
this is 6 pthread
this is 7 pthread
this is 8 pthread
this is 9 pthread
分析：先执行了一次主进程中的printf(&quot;t ..]]></description>
 <link><![CDATA[http://aiothome.net/read.php?tid=6629#84789]]></link>
 <author><![CDATA[hyb8555]]></author>
 <category><![CDATA[Linux技术交流区]]></category>
 <pubdate><![CDATA[Tue, 17 May 2011 03:50:07 +0000]]></pubdate>
</item>
<item>
 <title><![CDATA[]]></title>
 <description><![CDATA[lz的解释和我运行的有出入：

代码：
#include&lt;stdio.h&gt;
#include&lt;pthread.h&gt;
#include&lt;unistd.h&gt;
#include&lt;stdlib.h&gt;
void thread(void)
{
int i;
for(i=0;i&lt;10;i++){
sleep(1);
printf(&quot;this is %d pthread\n&quot;,i);
}
}
int main(void)
{
pthread_t id;
int i,ret;
ret = pthread_ ..]]></description>
 <link><![CDATA[http://aiothome.net/read.php?tid=6629#84784]]></link>
 <author><![CDATA[hyb8555]]></author>
 <category><![CDATA[Linux技术交流区]]></category>
 <pubdate><![CDATA[Tue, 17 May 2011 03:11:43 +0000]]></pubdate>
</item>
</channel></rss>