[Qt-interest] Qsqlite performance with multiple processes ?
Bill KING
bill.king at trolltech.com
Wed Apr 1 00:50:16 CEST 2009
Also, if you're looking at performance/locking from a multi-process
situation, sqlite's not really the right tool for the job. A more full
featured db engine would be recommended then. There are some
zero-administration dbs out there, firebird's a good example.
Stephen Collyer wrote:
> 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
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
Bill King, Software Engineer
Qt Software, Nokia Pty Ltd
Brisbane Office
More information about the Qt-interest-old
mailing list