title: Does Creating a New Thread Duplicate File Descriptors and Socket Descriptors in Linux?
body: <p>Everyone knows the classic model of a process listening for connections on a socket and forking a new process to handle each new connection.  Normal practice is for the parent process to immediately call <code>close</code> on the newly created socket, decrementing the handle count so that only the child has a handle to the new socket.</p>
  
  <p>I've read that the <strong>only difference</strong> between a process and a thread in Linux is that threads share the same memory.  In this case I'm assuming spawning a new thread to handle a new connection also duplicates file descriptors and would also require the 'parent' thread to close it's copy of the socket?</p>