Just as an FYI on the threading ... http://www.sqlite.org/capi3ref.html#sqlite3_open

"The returned sqlite3* can only be used in the same thread in which it was created. It is an error to call sqlite3_open() in one thread then pass the resulting database handle off to another thread to use. This restriction is due to goofy design decisions (bugs?) in the way some threading implementations interact with file locks."

-martin

----- Original Message ----- From: "Ed Pasma" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Thursday, May 17, 2007 4:18 PM
Subject: Re: [sqlite] One more SQLite threading question


However, it would be too time consuming to serialize every call to
sqlite3_step(), so I wonder whether it can be called in another thread.

This almost immediately raises
"library routine called out of sequence". It occurs as soon as the
processing of A and B overlap, that means A is preparing statement #2
while B is still executing #1.

Have you tried using Mutex or some other way to prevevent really
simultaneous calling of SQLite methods? My guess that it should work
well then, but I haven't tried it myself...

Yes I did the same experiment with a lock that made thread A wait until B was finished. So actually only one thread can be active at the time. I don't see how the outcome of this experiment can be of any interest, as there is no time reduction any longer. But your guess is right that, it works.


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------




-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to