<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[PHP的pthreads扩展：真正的PHP多线程（绝非fork或者用http再开进程）。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Thu, 23 May 2013 01:50:56 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：很多PHPer想PHP也像Java / c++ 一样能支持多线程，于是就有了，在新的版本里加了这样一个扩展，之所以它能行，因为Linux本身就支持，用C扩展一下就可以了，这样用到底成熟不，还是值得时间和对这种应用的需求程度进行检验。<br/><br/>扩展地址：<br/>http://pecl.php.net/package/pthreads<br/><br/><br/>#如果你的autoconfig版本高于2.59，则只能安装php5.4 <br/>#否则你只可以安装5.3.17。如果知道你的autoconf的版本——如果你已经安装了php.5.4那么，你就安装照5.4的安装；如果装了5.3就装5.3 <br/> <br/>#5.4 <br/>wget<br/>tar zxvf php-5.4.7.tar.gz <br/>cd php-5.4.7/ext <br/> <br/>#5.3 <br/>wget<br/>tar -xf php-5.3.17.tar.gz <br/>cd php-5.3.17/ext <br/> <br/> <br/>#下面装pthreads <br/>wget https://github.com/krakjoe/pthreads/tarball/master -O pthreads.tar.gz <br/>tar -xf pthreads.tar.gz <br/>mv krakjoe-pthreads* pthreads <br/>cd ../ <br/>./buildconf --force <br/>./configure --enable-maintainer-zts --enable-pthreads --prefix=/usr/local/php-threads#其它参数自行配置，这里只是必须的参数 <br/>make <br/>make install <br/><br/>源码包里面有例子，像这样执行：<br/><br/>/usr/local/php-threads/bin/php AdvancedSynchronization.php<br/><br/>[plain] <br/>Process: running <br/>ScopeTest: 140703850592000 running <br/>ScopeTest2: 140703839512320 running <br/>ScopeTest2: 140703839512320 working ... <br/>ScopeTest2: 140703839512320 notified: 1 <br/>Process: notifying 140703839512320: 1 <br/>ScopeTest: 140703850592000 notified: 1 <br/>Process: notifying 140703850592000: 1 <br/> <br/><br/>通过apache执行的还没有试过，因为我不想破坏现有的php环境，而且我也不打算在非cli模式下执行。<br/><br/>以上参考来自：http://www.2cto.com/kf/201209/157350.html
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] PHP的pthreads扩展：真正的PHP多线程（绝非fork或者用http再开进程）。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>