On Tue, Jul 28, 2009 at 07:59:23AM -0400, Igor Tandetnik scratched on the wall:
> pierr wrote:
> >   Any insight? Should I go with THREADSAFE=2 and two connections: one
> > for read ,another for write? Thanks.
> 
> THREADSAFE is not a number of allowed concurrent threads. It's a boolean 
> switch - 0 means non-threadsafe, non-zero means thread-safe. 
> THREADSAFE=2 won't make any difference.

  THREADSAFE=1 is "Serialize mode" and THREADSAFE=2 is "Multithread"
  mode.  THREADSAFE=2 (basic Multithread) actually offers less protection,
  requiring the application to provide its own locks to prevent multiple
  threads from accessing the DB at the same time, while THREADSAFE=1
  (Serialize) handles all that for you.  Generally, unless you're doing
  a lot of thread and lock management yourself, you want to use =1.

  http://sqlite.org/compile.html#threadsafe
  http://sqlite.org/threadsafe.html

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to