lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajay_garg <garg.jeena.isi.ka.naam....@gmail.com>
Subject Re: Query in Lucene 2.3.0
Date Sun, 03 Feb 2008 16:44:44 GMT

Thanks again Mike. 
In fact, I have just finished going throught the CHANGE.TXT file, that
mentions the entire journey details of Lucene, right from 1.4 to 2.3. And of
course, got to know many more things.

Just a couple of issues more.

Firstly, in the 2.3 optimizations, point 4 says ::
" 4. LUCENE-959: Remove synchronization in Document (yonik)".

Well, what does that mean, since it has already been assured that multiple
adds, deletes, updates CAN be done by multiple threads on a single
IndexWriter instance.



Secondly, this multiple-threads-doing-simultaneous-adds-deletes-modifies
works for me in 2.3; moreover, the source code has also confirmed this ( in
the IndexWriter.java file). However, does this hold true to prior 2.3
versions also ( I see that you state that multiple threads using same
instances has "always" been fine, but just want to confirm it once again, as
to exactly from when on .. ).

Sorry, if I sound a little too demanding, but the fact is that I have just
completed my multi-threader project using 2.3.0 jar after a lot of
head-banging, and wish to know, that will everthing go well prior to 2.3.0,
as far as
multiple-threads-involved-in-multiple-simultaneous-adds/deletes/modofies-on-a-single-indexwriter-instance
is concerned.

Thanks
Ajay Garg

Michael McCandless-2 wrote:
> 
> 
> The write.lock has always been to prevent multiple instances of  
> IndexWriter (or, IndexReader doing deletes) from operating on the  
> same index at a time.
> 
> Many threads sharing a single instance of these classes has always  
> been fine.
> 
> Mike
> 
> ajay_garg wrote:
> 
>>
>> @Mike.
>>
>> Thanks for the reply. But I had thought that write.lock is there to  
>> prevent
>> multiple additions/updates/deleteDocuments.
>>
>> Has there been a change recently in this regard ?
>>
>> Thanks
>> Ajay Garg
>>
>>
>>
>> Michael McCandless-2 wrote:
>>>
>>>
>>> That's right.
>>>
>>> Each thread can enter IndexWriter.add/update/deleteDocument(s) in
>>> parallel.  There are some parts inside IndexWriter that are
>>> synchronized but they are kept to a minimum to keep good thread
>>> concurrency.  As you add threads it's best to increase the RAM buffer
>>> at the same time to get better performance.
>>>
>>> Mike
>>>
>>> ajay_garg wrote:
>>>
>>>>
>>>> @Yonik
>>>>
>>>> So you mean to say, that if two threads have the same instance of an
>>>> IndexWriter passed to both of them, and both these threads run on  
>>>> two
>>>> different CPUs, then they can write to the index at the same time ?
>>>>
>>>>
>>>>
>>>> Yonik Seeley wrote:
>>>>>
>>>>> On Jan 30, 2008 10:59 PM, ajay_garg
>>>>> <garg.jeena.isi.ka.naam.hai@gmail.com> wrote:
>>>>>>
>>>>>> Thanks Mike for your directions.
>>>>>>
>>>>>> Yes, I am in fact using a single computer for my application, and
>>>>>> your
>>>>>> saying that in this case, multiple threads with a single
>>>>>> IndexWriter wll
>>>>>> give a better performance. Hmmm. I just wonder that since each
>>>>>> IndexWriter
>>>>>> has a single write.lock, this means that sitting on the CPU, we
>>>>>> observe
>>>>>> that
>>>>>> at a particular instant, only a single thread is using the CPU,
>>>>>
>>>>> The write.lock is to protect against other IndexWriter instances,
>>>>> *not* against other threads.
>>>>> Using multiple threads on a single IndexWriter should utilize
>>>>> multiple
>>>>> CPUs.
>>>>>
>>>>> -Yonik
>>>>>
>>>>> ------------------------------------------------------------------- 
>>>>> --
>>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> View this message in context: http://www.nabble.com/Query-in-
>>>> Lucene-2.3.0-tp15175141p15198783.html
>>>> Sent from the Lucene - Java Users mailing list archive at  
>>>> Nabble.com.
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/Query-in- 
>> Lucene-2.3.0-tp15175141p15221338.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Query-in-Lucene-2.3.0-tp15175141p15255268.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message