title: Single TCP/IP server that handles multiple clients (in C++)?
body: <p>I want to write a TCP/IP server in C++ (using <code>bind()</code>, <code>accept()</code> etc.) that can deal with multiple clients connecting to it at the same time.
  I have read a few topics about this, and everyone is suggesting the following (dirty pseudocode coming up):</p>
  
  <pre><code>set up server, bind it
  
  while (1) {
      accept connection
      launch new thread to handle it
  }
  </code></pre>
  
  <p>Which would work totally fine on a machine that has multiple threads. But my target system is a single core machine without any hardware threads. For a little test, I tried launching multiple threads via <code>std::thread</code> on the system but they were executed one after the other. No parallel goodness :(</p>
  
  <p>That makes it impossible to implement the algorithm above. I mean, I'm sure it can be done, I just don't know how, so I would really appreciate any help.</p>