[Qt-interest] Qsqlite performance with multiple processes ?

Scott Aron Bloom Scott.Bloom at sabgroup.com
Wed Apr 1 01:15:16 CEST 2009


SQLIte by their own admission essentially says its really unusable for any real multiprocess applications… J

 

Prior to 3.3.1 it was only usable inside the same thread that opened the database.  

 

That said.. while its technically feasible now.. This FAQ question really puts their spin on the problem

http://www.sqlite.org/faq.html#q6

 

Scott

 

 

 

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Stephen Collyer
Sent: Tuesday, March 31, 2009 1:27 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Qsqlite performance with multiple processes ?

 

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/68916da2/attachment.html 


More information about the Qt-interest-old mailing list