<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ipc on Johnny Huang</title><link>https://hzqtc.github.io/tags/ipc/</link><description>Recent content in Ipc on Johnny Huang</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 27 Jul 2012 00:00:00 +0000</lastBuildDate><atom:link href="https://hzqtc.github.io/tags/ipc/index.xml" rel="self" type="application/rss+xml"/><item><title>Linux IPC with Pipes</title><link>https://hzqtc.github.io/2012/07/linux-ipc-with-pipes.html</link><pubDate>Fri, 27 Jul 2012 00:00:00 +0000</pubDate><guid>https://hzqtc.github.io/2012/07/linux-ipc-with-pipes.html</guid><description>&lt;p&gt;Inter-Process Communication (IPC) is a set of methods for exchanging data among multiple processes. IPC is a very common mechanism in Linux and Pipe maybe one of the most widely used IPC methods. When you type &lt;code&gt;cat foo | grep bar&lt;/code&gt;, you create a pipe to connect &lt;em&gt;stdout&lt;/em&gt; of &lt;code&gt;cat&lt;/code&gt; to &lt;em&gt;stdin&lt;/em&gt; of &lt;code&gt;grep&lt;/code&gt;. A pipe, as its name states, can be understood as a channel with two ends. Pipe is actually implemented using a piece of kernel memory. The system call &lt;code&gt;pipe&lt;/code&gt; always create a pipe and two associated file descriptions, &lt;code&gt;fd[0]&lt;/code&gt; for reading from the pipe and &lt;code&gt;fd[1]&lt;/code&gt; for writing to the pipe.&lt;/p&gt;</description></item></channel></rss>