diff --git a/README.md b/README.md index dc472ef..3ba8b6d 100644 --- a/README.md +++ b/README.md @@ -151,3 +151,16 @@ In this implementation, the hashing functions used is [murmurhash](github.com/tw Given the particular hashing scheme, it's best to be empirical about this. Note that estimating the FP rate will clear the Bloom filter. + + + + +### Goroutine safety + +In general, it not safe to access +the same filter using different goroutines--they are +unsynchronized for performance. Should you want to access +a filter from more than one goroutine, you should +provide synchronization. Typically this is done by using channels (in Go style; so there is only ever one owner), +or by using `sync.Mutex` to serialize operations. Exceptionally, you may access the same filter from different +goroutines if you never modify the content of the filter.