[Xapian-discuss] minor problem

Olly Betts olly at survex.com
Fri Jan 11 00:49:43 GMT 2008


On Thu, Jan 10, 2008 at 09:20:44PM +0000, James Aylett wrote:
> (Incidentally, <http://www.cygwin.com/ml/cygwin/2001-08/msg00854.html>
> seems to be saying the same thing.)

Yes (amongst other things).  If you search the web, you'll find a number
of people have tripped over the "doesn't work between threads of the
same process" issue.

> ISTR that SQLite knows about this. It doesn't work round it, IIRC, it
> just tells you it's a problem in the documentation somewhere. (SQLite
> believes that Threads Are Evil.)

Do you mean their FAQ #6, which says (amongst other things):

    Prior to version 3.3.1, an sqlite3 structure could only be used in
    the same thread that called sqlite3_open  to create it. You could
    not open a database in one thread then pass the handle off to
    another thread for it to use. This was due to limitations (bugs?) in
    many common threading implementations such as on RedHat9.
    Specifically, an fcntl() lock created by one thread cannot be
    removed or modified by a different thread on the troublesome
    systems. And since SQLite uses fcntl() locks heavily for concurrency
    control, serious problems arose if you start moving database
    connections across threads.

That's actually a different issue, though it's another benefit of using
a child process to acquire and hold the lock if such systems are still
relevant (RedHat 9 must be obsolete by now).  It looks like RedHat 9 was
the debut for NPTL, so if these were bugs, they should be fixed in
current distros.

Cheers,
    Olly



More information about the Xapian-discuss mailing list