D. Richard Hipp wrote:
On Fri, 2005-07-15 at 16:41 +0530, Roushan Ali wrote:

Hello all,
         Can we use single sqlite_open handle(global) across threads(
if all database operations are serialized by using semaphore) ? Please
help.


Opening a database connection in one thread and using it in another
will work on some operating systems but not on others. You are advised not to do it. See http://www.sqlite.org/cvstrac/tktview?tn=1272
and http://www.sqlite.org/cvstrac/chngview?cn=2521.

Good sound advice, to a point.

Multiple threads accessing the same connection *can* be done, its a design time issue that needs to be addressed before even a single line of code is written.

I do it with my mail server using SQLite for logging purposes, I use mutex semaphores to handle the nitty gritty details.

Its the usual issue of knowing what you are stepping into before you step, because some of what you step into stinks.

--
Craig Morrison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
http://www.mtsprofessional.com/
  A Win32 email server that works for You.

Reply via email to