[ 
https://issues.apache.org/jira/browse/LUCENE-818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477723
 ] 

Yonik Seeley commented on LUCENE-818:
-------------------------------------

> Doesn't crossing a synchronization barrier ensure that all threads will seem 
> the same value of a field?

Yes, if the changing thread crosses a write barrier and the reading  thread 
crosses a read barrier.

The obvious implication that you need to synchronize the sets/gets of isClosed. 
 That's not a big deal in some cases, but in anything that could be in an inner 
loop, it is a big deal.  We already have reports of simple things like 
isDeleted() being a bottleneck on servers with many CPUs and concurrent threads 
because of the synchronization.  That particular sync point is something that 
I've planned to get rid of at some point in the future by having a "read only" 
IndexReader.


> IndexWriter should detect when it's used after being closed
> -----------------------------------------------------------
>
>                 Key: LUCENE-818
>                 URL: https://issues.apache.org/jira/browse/LUCENE-818
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.1
>            Reporter: Michael McCandless
>         Assigned To: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-818.patch, LUCENE-818.take2.patch
>
>
> Spinoff from this thread on java-user:
>     http://www.gossamer-threads.com/lists/lucene/java-user/45986
> If you call addDocument on IndexWriter after it's closed you'll hit a
> hard-to-explain NullPointerException (because the RAMDirectory was
> closed).  Before 2.1, apparently you won't hit any exception and the
> IndexWrite will keep running but will have released it's write lock (I
> think).
> I plan to fix IndexWriter methods to throw an IllegalStateException if
> it has been closed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to