On Aug 9, 2010, at 11:30 AM, David Barrett wrote:

> I'm reading up on the new write-ahead logging feature, and I'm unclear
> on one point: does WAL only help alleviate multi-threaded locking (by
> allowing other threads to continue reading while one is writing), or
> does WAL also help between multiple processes?
>
> My understanding could be completely wrong, but I think the following
> statements are true -- can you help fact check me?  (I've read
> http://www.sqlite.org/lockingv3.html but it doesn't seem to have been
> updated for WAL -- assuming any updates are even needed.)
>
> 1) Two processes can read from the same database at the same time.
>
> 2) However, one process cannot read from the database while another is
> writing -- WAL is irrelevant here.
>
> 3) One process can have two threads that read from the database from  
> the
> same time.
>
> 4) And thanks to WAL, now one process can have one thread writing and
> any number of threads reading at the same time.
>
> 5) However, WAL does not allow multiple threads to write at the same  
> time.
>
> Is this right?  Or am I totally off?  Are there any good pages  
> outlining
> the intersection between multi-process database locking and WAL?   
> Thanks!

Unless shared-cache mode is turned on, multiple threads each using
their own sqlite3* connection should behave in the same way as
multiple processes do wrt to sqlite locking.

If you do enable shared-cache mode, the rules here apply:

   http://www.sqlite.org/sharedcache.html

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

Reply via email to