Hi, Tom:
I got it.
There is no particular reason I need to have multiple writer threads.
Thanks for your help!
2009-11-11
-----------------
Best wishes from Ray.
???? Tom
????? 2009-11-11 19:30:35
???? ???
??? xapian-discuss
??? Re: [Xapian-discuss] Is there any problem with multithread?
2009/11/11 ??? <ysj.ray at gmail.com>:> Hi, all:
>
> I am now using xapian in a web environment, I need multithread for
writing the database.
> So I wonder if there is any problem with multithread for
writing?(all the threads share a single WritableDatabase object)
Hi Ray,
WritableDatabase objects can only be used by a single thread.
Generally the best approach is to marshal all your writes into a
single structure (e.g. a queue or spool directory) and have a thread
or process to pick off items and write them to the database.
Is there any particular reason you want to have multiple writer threads?
cheers,
Tom