[Xapian-devel] About memory index/search in multithread program
Yanxiong Lu
yanxionglu at gmail.com
Fri Jun 27 06:20:45 BST 2014
That code can't work, it is pseudo-code.
As I already tried to explain, if you're concerned about performance,
the current inmemory backend isn't the answer you are looking for.
I will write a memory based SE with WAND merge algorithm and proximity
similarity
algorithm(BM25 don't use position).
Thank you very much.
2014-06-26 14:33 GMT+08:00 Olly Betts <olly at survex.com>:
> On Thu, Jun 26, 2014 at 01:19:20PM +0800, Yanxiong Lu wrote:
> > There may be some solutions,for example
> > class XAPIAN
> > {
> > *static* int InitDatabase(); //for reading only, do not need lock,
> but
> > if writing use lock
> > int Search(); //safe in one object, do not need lock
> > };
> > XIPIAN xp[ THREAD_NUM ];
> >
> > one thread use one object, they use one database.
> > these can be in memory with one database.
>
> As I already tried to explain, if you're concerned about performance,
> the current inmemory backend isn't the answer you are looking for.
> Eliminating the need for the user to lock around searches isn't going to
> magically solve that.
>
> I don't really see how your 6 line sketch above helps either. Xapian
> makes *NO* thread-safety guarantees - even in the "reading only" case
> you should be locking. Even if it happens to work currently, there's
> no guarantee it'll work in the next release.
>
> Cheers,
> Olly
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20140627/f3500ffd/attachment.html>
More information about the Xapian-devel
mailing list