According to the documentation :

"database connection in read-uncommitted mode does not attempt to obtain
read-locks before reading from database tables as described above. This can
lead to inconsistent query results if another database connection modifies a
table while it is being read, but it also means that a read-transaction
opened by a connection in read-uncommitted mode can neither block nor be
blocked by any other connection."

Correct me if I'm wrong but if the "shared cache" access is locked for each
sqlite3_step, so it's not possible to have inconsistent query results.. and
no possible "real" parallel read/write.

Regards



> I don't know what Dan meant by his words but AFAIK there's no mutex
> making exclusive grab of shared cache by sqlite3_step() call. There is
> only mutex making sqlite3_step() execution exclusive for connection
> object.

I meant the mutex that is a member of the BtShared struct
(BtShared.mutex). Grabbed by the call to sqlite3VdbeMutexEnterArray()
at the top of sqlite3VdbeExec() and not released until that function
returns.

Pavel is right, technically it's not grabbed by sqlite3_step(). But
99% of the time spent in sqlite3_step() will be spent in a single call
to sqlite3VdbeExec(), so the effect is similar.

Dan.




> Pavel
>
> On Wed, Nov 18, 2009 at 8:40 AM, presta <harc...@gmail.com> wrote:
>>
>> I'm confused according to Dan Kennedy :
>>
>> "Each shared-cache has its own mutex. The mutex is held for the  
>> duration
>> of each sqlite3_step() call. So the way you're defining it here, you
>> can't have "real" concurrency when using shared-cache mode in any  
>> case. "
>>
>> So, it's a little bit "antagonist" to say "with shared cache they  
>> will be
>> parallelized pretty effectively in the same file too"
>>
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Asynchronous-I-O-and-shared-cache-tp26402983p26407922.html
>> Sent from the SQLite mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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



-- 
View this message in context: 
http://old.nabble.com/Asynchronous-I-O-and-shared-cache-tp26402983p26421364.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to