From f6bd22605eef3d921f90360fbefa1d1f6ce853f2 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Mon, 9 Sep 2024 09:11:05 -0400 Subject: [PATCH] [no-ci] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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.