title: Non-blocking I/O versus using threads (How bad is context switching?)
body: <p>We use sockets a lot in a program that I work on and we handle connections from up to about 100 machines simultaneously at times.  We have a combination of non-blocking <a href="http://en.wikipedia.org/wiki/Input/output" rel="noreferrer">I/O</a> in use with a state table to manage it and traditional Java sockets which use threads.  </p>
  
  <p>We have quite a few problems with non-blocking sockets and I personally like using threads to handle sockets much better. So my question is:</p>
  
  <p>How much saving is made by using non-blocking sockets on a single thread?  How bad is the context switching involved in using threads and how many concurrent connections can you scale to using the threaded model in Java?</p>