title: Threads vs Asynchronous Networking (Twisted) Python
body: <p>I am writing an implementation of a NAT.  My algorithm is as follows:</p>
  
  <ol>
  <li>Packet comes in</li>
  <li>Check against lookup table if external, add to lookup table if internal</li>
  <li>Swap the source address and send the packet on its way</li>
  </ol>
  
  <p>I have been reading about Twisted.  I was curious if Twisted takes advantage of multicore CPUs?  Assume the system has thousands of users and one packet comes right after the other.  With twisted can the lookup table operations be taking place at the same time on each core.  I hear with threads the GIL will not allow this anyway.  Perhaps I could benifit from multiprocessing></p>
  
  <p>Nginix is asynchronous and happily serves thousands of users at the same time.</p>