MGunlogson / CuckooFilter4J

High performance Java implementation of a Cuckoo filter - Apache Licensed
Apache License 2.0
174 stars 39 forks source link

putIfAbsent support #8

Open naude-r opened 6 years ago

naude-r commented 6 years ago

the sequence of mightContain + put is racy.

would it make sense to create a putIfAbsent variant that is atomic and race-free from the callers point of view?

or are there other options available to achieve something similar without synchronizing on the CuckooFilter instance?