[Xapian-discuss] Node.js binding

Olly Betts olly at survex.com
Thu Oct 20 22:32:25 BST 2011


On Thu, Oct 20, 2011 at 01:17:45PM -0700, Liam wrote:
> On Thu, Oct 20, 2011 at 12:06 PM, Richard Boulton <richard at tartarus.org>wrote:
> > What I was concerned about was concurrent calls to methods of Xapian
> > objects, which this doesn't avoid.  For example, if the main thread
> > has a "db" variable pointing to a Xapian database, and starts a
> > get_mset() operation, the get_mset() operation will be performed using
> > the Xapian database in a subthread.  From what you describe, there's
> > nothing stopping the main thread kicking off another get_mset()
> > operation (or any other operation which would access the database)
> > before the subthread finishes, which would cause problems.
> 
> Concurrent calls to the same method of *different* objects cause problems??

That isn't actually the example Richard was trying to describe.

But note that this extends to objects which use each other internally,
so for example you indeed can't safely concurrently call the same method
on two TermIterator objects which are from the same Database.

Cheers,
    Olly



More information about the Xapian-discuss mailing list