It?s a mistake ofexpression.
I mean,
1. readconcurrently indifferent threads.
or
2. write in one thread andread inother threads.
noconcurrently writing happened.


Sorry about this. I come from a not-English-speaking country, it's hard for me 
to express myself.


????
???:Simon Slavinslavins at bigfraud.org
???:General Discussion of SQLite Databasesqlite-users at mailinglists.sqlite.org
????:2015?10?9?(??)?20:38
??:Re: [sqlite] Is it possible that keep SQLite in normal lockingmodewithout 
mmap?


On 9 Oct 2015, at 1:29pm, sanhua.zh sanhua.zh at foxmail.com wrote:  2. 
multithread-reading-and-writing, not serial It is not possible for two 
different operations, whether different threads or different processes, to 
write to a database at the same time. No matter what system you use this just 
isn't possible. To prove this to yourself, imagine that you had a table with a 
UNIQUE index, and that two threads/processes tried to write rows with the same 
key. The correct way for the API to respond would be to allow one to write its 
row, and to return an error to the other. This cannot happen if the system 
accepts both write requests at the same time. Writing to a database /must/ be 
serial. There is a work-around for this which involve writing new rows by 
appending the data to a text file (entirely outside SQL) and having another 
process read its way through the text file updating the database file. 
Appending to a text file is faster than updating a SQLite database. There are 
other work-arounds too. But they all involve writing new data to some place 
which is not the live database. Simon. 
_______________________________________________ sqlite-users mailing list 
sqlite-users at mailinglists.sqlite.org 
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to