title: What is best, a Single-threaded or a multi-threaded server?
body: <p>I have to create a simple client&lt;->server communication to transfer files using C language (Linux).</p>
  
  <p>The server accept connections on the 10000 port, I don't know if is better to create a new thread each request or create a fixed numbers of threads and use asynchronous technique.</p>
  
  <pre><code>CASE A:
  
  client --&gt; server --&gt; (new thread) --&gt; process the request
  
  CASE B:
  
  SERVER --&gt; create thread 1 - thread 2 - thread 3
  
  then
  
  client1 --&gt; server --&gt; thread 1
  client2 --&gt; server --&gt; thread 2
  client3 --&gt; server --&gt; thread 3
  client4 --&gt; server --&gt; thread 1
  client5 --&gt; server --&gt; thread 2
  client6 --&gt; server --&gt; thread 3
  </code></pre>
  
  <p>In this case thread 1 could process many client's requests</p>
  
  <p>My considerations:</p>
  
  <p><strong>CASE 1:</strong> Is faster but waste a lot of memory</p>
  
  <p><strong>CASE 2:</strong> Is slower but use a low memory</p>
  
  <p>Am I wrong?</p>