From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp
>The underlying error here is that you are attempting to use threads in the
first place.  You should never do that.  Threads are evil and should be
avoided wherever possible.  Use separate processes > for concurrency.
Threads in application programs always result in subtle bugs (such as this
one) that are hard to reproduce and waste countless hours of developer time.
Just say "no" to threads.

Richard, you've said this many times on this list.  Wouldn't using separate
processes hurt performance significantly?  It means you can't ever share the
page cache (either by sharing an SQLite connection between threads in a
serial way protected by mutex, etc, or by actually using shared cache
semantics).  And getting concurrency with processes means you introduce the
complexities of interprocess communication/synchronization which is much
easier to handle with threads in the same process.  

But you are right about the costs -- the benefits of using threads incur a
cost -- a cost of being very careful.

Doug



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to