title: About pipe behavior in windows
body: <pre><code>    hPipe = CreateNamedPipe( 
            lpszPipename,             // pipe name 
            PIPE_ACCESS_DUPLEX,       // read/write access 
            PIPE_TYPE_MESSAGE |       // message type pipe 
            PIPE_READMODE_MESSAGE |   // message-read mode 
            PIPE_WAIT,                // blocking mode 
            PIPE_UNLIMITED_INSTANCES, // max. instances  
            BUFSIZE,                  // output buffer size 
            BUFSIZE,                  // input buffer size 
            0,       
  </code></pre>
  
  <p>I have two questions about this:</p>
  
  <ol>
  <li>what if the above code is run twice,how many pipes will get created,<code>1</code> or <code>2</code>? </li>
  <li>if <code>2</code>,suppose one of the pipe get connected by <strong>A</strong>,then <strong>B</strong> tries to connect <code>lpszPipename</code>, is it guaranteed that <strong>B</strong> will connect to the one that no one has connected?</li>
  </ol>