[Xapian-discuss] Xapian::Document and threads

Jean-Francois Dockes jf at dockes.org
Sun May 4 19:16:50 BST 2014


Hi,

While investigating very infrequent crashes in the Recoll indexer, I have
come to a very basic question: is it safe to pass a copy of a
Xapian::Document from thread to thread (multiple threads queue documents,
other thread updates the index) ?

I don't seem to get directly into trouble while doing this, but I don't see
anything either in the RefCntr implementation which would explicitely make
it thread-safe, so I am wondering. Maybe I'm just missing the obvious.

Of course, I could create the docs on the heap instead, and pass pointers,
but is this needed ?

Cheers,

jf




More information about the Xapian-discuss mailing list