[EMAIL PROTECTED] wrote:
It has been suggested that I add a mutex to every SQLite
database connection. This would cause access to a database
connection to automatically serialize even when two or more
threads try to use that connection at once, thus preventing
problems such as the above.
The downside is the (minimal) additional overhead of acquiring
and releasing a mutex on each API call. There will also be
some changes to the OS-layer backend which will break
private ports to unusual OSes.
Thoughts?
--
D. Richard Hipp <[EMAIL PROTECTED]>
IMHO:
Don't do it. Those of us that want to use threads should create our own
threaded sqlite wrappers.
I might make several sqlite calls that I don't want interwoven with
other sqlite calls from other threads. I rely on my own mutexes.
Granted, I can continue to use my own mutexes.. I just think that you
should not add mutex code when:
a) (guessing here) a sizable group of users don't use mutliple threads
anyway.
b) it would break the private OS ports as you mentioned.
c) the library can alreayd be made thread safe via external logic.
If you try to stop people from shooting themselves in the foot, they'll
just pull a Dick Chenney on you and shoot someone else.