[Xapian-discuss] Multithread problem: Writing to a db disables reading from another one

Olly Betts olly at survex.com
Mon Aug 23 23:57:18 BST 2004


On Tue, Jul 13, 2004 at 01:32:25PM +0200, Robert Pollak wrote:
> I then expanded Richard's example by adding a second writer that writes to 
> a separate database (see attachment).
> (I am also reopening the db if necessary.)
> Now the queries give empty results!
> Commenting out the creation of _writer2 makes the queries return the 
> expected results again (3).
> 
> I wonder whether Olly or someone else can reproduce this.

I've just tried it, compiling with GCC 2.95.4 (since that's what I
currently happen to have a handy Xapian built with).  I need to add
"#include <stdio.h>" to get sprintf prototyped, and when I run the
program it segfaults trying to use memcpy inside std::string inside
quartz.  I think this is probably the lack of thread safety in the
string class which Richard mentioned.

I'll try further tests, but probably not until next week.

> I have not tried modifying any Xapian compile options, because I am an 
> automake newbie.
> Would I have to edit Makefile.in (and how whould I do this), or would I 
> just pass arguments to configure?

Just pass arguments to configure.  To pass extra flags for compiling
C++, run configure like this:

./configure CXXFLAGS=-magic

Similarly for LDFLAGS (for linking), CFLAGS (for compiling C), and
CPPFLAGS (for the preprocessor).  "./configure --help" will remind
you of these.

Cheers,
    Olly



More information about the Xapian-discuss mailing list