title: SQLite: Sharing Connections across threads to read and write
body: <p>I have an application that uses SQLite(version 3.7.2) to store data. I have a SQLite connection shared between multiple threads that writes and reads from the same SQLite db. SQLite is compiled with DSQLITE_THREADSAFE=1 which means SQLite is in Serialized mode. </p>
  
  <p>Quoting from <a href="http://www.sqlite.org/threadsafe.html">SQLite docs</a></p>
  
  <blockquote>
    <p>Serialized: In serialized mode, SQLite can be safely used by multiple
    threads with no restriction.</p>
  </blockquote>
  
  <p>On the contrary the <a href="http://www.sqlite.org/cvstrac/wiki?p=MultiThreading">SQLite Wiki</a> entry says </p>
  
  <blockquote>
    <p>Do not use the same database connection at the same time in more than
    one thread</p>
  </blockquote>
  
  <p>I tried with a sample application that spawns hundreds of threads and shares an SQLite handle to read &amp; write which is working fine. </p>
  
  <p>So is the SQLite wiki entry outdated or SQLite might not be able to handle read and write happening from different threads at the same time using the same connection?</p>