[Xapian-discuss] Re: Trying to use db.reopen()

Fabrice Colin fabrice.colin at gmail.com
Sat Jan 14 03:59:41 GMT 2006


On 1/14/06, Olly Betts <olly at survex.com> wrote:
> On Sat, Jan 14, 2006 at 11:26:03AM +0800, Fabrice Colin wrote:
> > Does this mean it will be safe to have N readers and 1 writer accessing the
> > index concurrently without extra locking ?
>
> Yes.  The plan is that the writer will attempt to exclusively lock a
> revision prior to discarding it.  If the attempt fails (which will
> happen if a reader has a non-exclusive lock on that revision), it won't
> discard that revision yet.  And multiple readers can non-exclusive lock
> the same revision.
>
Great. I guess this is planned for after v0.9.3 ?

> Note that N readers and 1 writer is safe at the moment too (well, except
> for the annoyances of DatabaseModifiedError, but that's the case with 1
> reader and 1 writer too).  Your question could be read as suggesting it
> isn't, so I just thought I'd clarify...
>
Yes, you're right. To avoid DatabaseModifiedError, my app limits itself to
N readers _or_ 1 writer (enforced with a rwlock).

Fabrice



More information about the Xapian-discuss mailing list