John Elrick <john.elr...@fenestra.com> wrote:
> Nuno Lucas wrote:
>> If you open a sqlite shell and do:
>>
>> SQLite version 3.6.14.2
>> Enter ".help" for instructions
>> Enter SQL statements terminated with a ";"
>> sqlite> begin;
>> sqlite> begin;
>
> Since we are discussing threads here, the example is meaningless.
> "begin" is a piece of text which is parsed into opcodes and then
> processed by a complied virtual machine.  Threads switch at the
> machine code level, so a thread could switch between the processing
> of the 'g' and the 'i' of the first 'begin'.

SQLite actually maintains a mutex per connection. Every API call 
acquires this mutext and keeps it for the duration of the call. Thus no 
two calls can proceed simultaneously on the same connection.

So no, another thread cannot interfere while sqlite3_prepare call 
advances from 'g' to 'i'.

Igor Tandetnik 



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

Reply via email to