Re: Thread safety?

Subject: Re: Thread safety?

Date: Tue, 21 Feb 2023 07:59:51 -0400

To: Kevin Boulain,


From: David Bremner

Kevin Boulain <> writes:

> So, is Notmuch expected to be thread safe? There are some indications it
> should be (e.g.: lib/ has locking) but all instances of
> Xapian::Query::MatchAll would have to be replaced.
> Xapian states it's thread safe:

Hi Kevin;

Thanks for tracking this down. I did try some experiments a while ago
with multi-threaded indexing (which is where the locking you mentioned
arose), but overall it isn't well tested (by me).  It seems reasonable
to try to provide the same level of thread safety as Xapian does. So I
guess we should go ahead and replace all of the MatchAll objects. I'm
guessing this might apply to Xapian::Query::MatchNothing as well.
Probably preprocessor macros wrapping Xapian::Query(std::string()) and
whatever the equivalent for MatchNothing is would make this easier to

notmuch mailing list --
To unsubscribe send an email to