lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selva Kumar <selva.kumar.at.w...@gmail.com>
Subject Re: Lucene 5 : are FixedBitSet and SparseFixedBitSet thread-safe? <eom>
Date Sun, 13 Sep 2015 20:06:54 GMT
Just trying to understand which local extends are still relevant OR need
refactoring after migration to Lucene 5. We use BitSets in online and
multi-threaded batch applications.

it seems FixedBitSet can be potentially used in divide and conquer by
applications without any locking.

Thanks Toke.

On Sun, Sep 13, 2015 at 11:39 AM, Toke Eskildsen <te@statsbiblioteket.dk>
wrote:

> Selva Kumar <selva.kumar.at.work@gmail.com> wrote:
> > Subject: Lucene 5 : are FixedBitSet and SparseFixedBitSet thread-safe?
> <eom>
>
> Short answer: No.
>
> Longer answer: Reading values and calling methods that does not modify the
> structure is fine. Writing values is not safe, but can work for
> FixedBitSet, if you take care not to update values within the same 64bit
> block from multiple Threads at a time.
>
> It is not too hard to make it Thread-safe and efficient
> (AtomicLongArray.compareandSet is your friend) and I made such a variant
> for a project, but the Solr-code is generaly very 1-request-1-Thread, so
> there is a lot of places to change code in order for it to take advantage
> of a changes FixedBitSet. What is it you are trying to achieve?
>
>
> - Toke Eskildsen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message