title: Tornado/Twisted - Celery - Gevent Comparison
body: <p>I'm having a bit of trouble understanding the differences between these three frameworks:</p>
  
  <ul>
  <li><a href="http://www.tornadoweb.org/en/stable/">Tornado</a>/<a href="http://twistedmatrix.com/trac/">Twisted</a></li>
  <li><a href="http://www.celeryproject.org/">Celery</a></li>
  <li><a href="http://www.gevent.org/">Gevent</a></li>
  </ul>
  
  <p>These three frameworks can be used to run code at the same time but do this in different way using a different amount of threads/processes or codestyle. This is how I'm understanding the differences right now:</p>
  
  <ul>
  <li><strong>Tornado/Twisted</strong> use asynchronous code controlled by an I/O loop. This allows the code to be ran on a single thread (multiple threads are useless because if you have non-blocking code this is unnecessary) </li>
  <li><strong>Celery</strong> uses a task based system to run code asynchronously, the code in itself is still synchronous. A main process exists that is able to distribute the different tasks between other workers on different processes.</li>
  <li><strong>Gevent</strong> uses a thread based system and spawns a thread to process different incomming connections.</li>
  </ul>
  
  <p>The Questions I'm having right now are:</p>
  
  <ol>
  <li>Is my understanding of these frameworks correct?</li>
  <li>The major difference between a thread and process is that different threads use the same memory whereas processes do not. Is one process normally run on one server core? (And thus making Celery hard to implement on a small server)</li>
  <li>If we are talking about <strong>webapplications and sockets</strong>:</li>
  </ol>
  
  <p><strong>Tornado/Twisted</strong> Are able to accept (almost) any amount of sockets because they use asyncronous code and queue the request in the I/O loop.</p>
  
  <p>Are <strong>Celery/Gevent</strong> able to this? Do they have to spawn a new process/thread to be able to accept a new socket?</p>
  
  <p>I'm trying to figure out which of these technologies is best suited to built a real-time web application.</p>