<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:media="http://search.yahoo.com/mrss/"
	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>异步 - 四号程序员</title>
	<atom:link href="https://www.coder4.com/archives/tag/%E5%BC%82%E6%AD%A5/feed" rel="self" type="application/rss+xml" />
	<link>https://www.coder4.com</link>
	<description>Keep It Simple and Stupid</description>
	<lastBuildDate>Thu, 13 Nov 2014 05:36:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>使用异步HTTP提升客户端性能(HttpAsyncClient)</title>
		<link>https://www.coder4.com/archives/4320</link>
					<comments>https://www.coder4.com/archives/4320#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Wed, 12 Nov 2014 09:02:14 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[HttpAsyncClient]]></category>
		<category><![CDATA[Java && J2EE]]></category>
		<category><![CDATA[异步]]></category>
		<category><![CDATA[非阻塞]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4320</guid>

					<description><![CDATA[大家都知道，应用层的网络模型有同步、异步之分。 同步，意为着线程阻塞，只有等本次请求全部都完成了，才能进行下一次请求。 异步，好处是不阻塞当前线程，可以“万箭齐发”的将所有请求塞入缓冲区，然后谁的请求先完成就处理谁。 大家也注意到了，同步模式阻塞的只是“线程”。实际上，在异步模式流行之前，人们也经常用多线程的方式处理并发请求。然而，随着数据规模的不断加大，线程开销所带来的CPU、内存剧增，因此这种方法的应用比较有限。 近几年来，随着异步处理方案在node.js、Nginx等系[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4320/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>异步回收fork出的子进程(僵尸进程)</title>
		<link>https://www.coder4.com/archives/151</link>
					<comments>https://www.coder4.com/archives/151#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Thu, 03 Dec 2009 09:11:15 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[waitpid]]></category>
		<category><![CDATA[僵尸]]></category>
		<category><![CDATA[异步]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=151</guid>

					<description><![CDATA[fork()之后，子进程和父进程分叉执行，僵尸进程的产生是因为父进程没有给子进程“收尸”造成的，又可以根据危害程度分为下述两类：
总体来说：当子进程结束之后，但父进程未结束之前，子进程将成为僵尸进程。
（1）当子进程结束之后，但父进程未结束之前，子进程将成为僵尸进程，父进程结束后僵尸被init进程回收。
（2）如果子进程结束了，但是父进程始终没有结束，那么这个僵尸将一直存在，而且随着exec，僵尸越来越多。
传统的方法是在parent中使用wait()等待子进程直到回收，但是这样就会一直阻塞，父进程什么都作不了了！
有没有别的方法呢？有！那就是使用waitpid()＋Signal的方法实现异步干掉僵尸进程。
原理：
(1)子进程退出的时候，会发送一个信号：SIGCHLD
(2)使用signal()可以指定程序处理某个信号量的对应handle函数
内附源代码。]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/151/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>用epoll实现异步的Echo服务器</title>
		<link>https://www.coder4.com/archives/135</link>
					<comments>https://www.coder4.com/archives/135#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Tue, 01 Dec 2009 16:39:45 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[epoll]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[异步]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=135</guid>

					<description><![CDATA[epoll是Kernel 2.6后新加入的事件机制，在高并发条件下，远优于select. 用个硬件中的例子吧，可能不太恰当：epoll相当于I／O中断（有的时候才相应），而select相当于轮询（总要反复查询）。 其实epoll比slect好用很多，主要一下几个用法。 struct epoll_event ; epoll事件体，事件发生时候你可以得到一个它。其中epoll_event.data.fd可以存储关联的句柄，epoll_event.event是监听标志，常用的有EPOLLIN （有数据[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/135/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Linux下用select()实现异步的Echo服务器</title>
		<link>https://www.coder4.com/archives/130</link>
					<comments>https://www.coder4.com/archives/130#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Mon, 30 Nov 2009 15:58:55 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[异步]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=130</guid>

					<description><![CDATA[本例子使用异步socket（select方法）实现了ECHO服务器程序。 搞了一个晚上，终于弄好了，出现的问题主要如下： 这是最重要的问题！当读取完数据后，需要将数据重新FD_SET进去，特别是serverFd，注意这个testFd意义非常重大，相当于参数传递中的复制行参，需要好好体会。 当read(rd)后，返回为0表示客户端的socket已经关闭，此时除了要FD_CLR，还要关闭fd!!否则fd资源没有被释放，很快就会达到select监听的上限！ [cpp] /* * main.c[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/130/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
