<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>bigfish的网络博客 - 网络</title>
      <link>https://blog.laofu.online</link>
      <description>记录技术和生活</description>
      <generator>Zola</generator>
      <language>zh</language>
      <atom:link href="https://blog.laofu.online/tags/wang-luo/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Sun, 26 Jan 2020 10:00:00 +0800</lastBuildDate>
      <item>
          <title>select、poll、epoll 的区别</title>
          <pubDate>Sun, 26 Jan 2020 10:00:00 +0800</pubDate>
          <author>bigfish</author>
          <link>https://blog.laofu.online/blog/select-poll-epoll/</link>
          <guid>https://blog.laofu.online/blog/select-poll-epoll/</guid>
          <description xml:base="https://blog.laofu.online/blog/select-poll-epoll/">&lt;p&gt;在多路复用的IO的模型中，存在三种机制，分别是&lt;code&gt;select&lt;/code&gt;，&lt;code&gt;poll&lt;/code&gt;和&lt;code&gt;epoll&lt;/code&gt;.为了便于理解，可以使用简单的伪代码来表示一个原始的IO的读写：&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;java&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-13 z-d-8&quot;&gt;     while&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;true&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     {&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-13 z-d-8&quot;&gt;          for&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;z-l-8&quot;&gt;Stream&lt;/span&gt;&lt;span class=&quot;z-l-3&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;z-l-13 z-d-8&quot;&gt;:&lt;/span&gt;&lt;span&gt; streamArr&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;          {&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-13 z-d-8&quot;&gt;               if&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;z-l-3&quot;&gt;i&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-6&quot;&gt;isNotReady&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-13 z-d-8&quot;&gt;                    continue&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-9 z-d-6&quot;&gt;               doSomething&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;          }&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     }&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description>
      </item>
    </channel>
</rss>
