I have been thinking about what it would take to make SimpleBloomFilter thread safe. I think that the answer is to use a copy on write strategy and a lock within all the merge methods.
However, this leaves the problem of the cardinality calculation. Currently it is lazily performed and cached. I am thinking that there are 2 solutions. 1. mark cardinality volatile and leave the calculation as it effectively does a copy on write. 2. update the cardinality inside the merge. This should be doable as we can get the number of bits in each long after the merge and simply add them up during processing. Does anyone see a problem with this solution? Claude -- LinkedIn: http://www.linkedin.com/in/claudewarren
