[Qt-interest] Qsqlite performance with multiple processes ?
Stephen Collyer
scollyer at netspinner.co.uk
Tue Mar 31 10:27:29 CEST 2009
I've taken a look at the Sqlite driver code in
sql/drivers/sqlite2/qsql_sqlite2.cpp
and I see the following code:
195 // keep trying while busy, wish I could implement this better.
196 while ((res = sqlite_step(currentMachine, &colNum, &fvals, &cnames))
== SQLITE_BUSY) {
197 // sleep instead requesting result again immidiately.
198 #if defined Q_WS_WIN32
199 Sleep(1000);
200 #else
201 sleep(1);
202 #endif
This seems to imply that if a sqlite DB is locked for write by another
process,
then this code would block the calling process for 1 second before a retry.
This would seem to make the sqlite driver unusable for any real multiprocess
applications.
So:
1) is my conclusion correct, or am I confused ?
2) why has such a huge retry interval been chosen ?
3) does anyone have real experience with qslite in a multiprocess app ?
--
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090331/a754ae5c/attachment.html
More information about the Qt-interest-old
mailing list