Hello, We have an application that relies heavily on caching OpenBitSets for reuse across multiple threads, and therefore multiple threads. I am looking into ways for making this both efficient and thread safe. In Java, the Immutable pattern is the most efficient way to make a cached object thread safe, because it does not require synchronization overhead. Unfortunately, this would require an implementation of OpenBitSet with the 'bits' and 'wlen' fields declared as final, and all mutator methods throwing unsupported. I can certainly extend the class to override the methods, but the fields cannot be overridden as final.
Are there any suggestions of the forum? Possibly other Lucene classes to solve this problem? Or other solutions? I'm just looking for ideas. Thanks. -John