diff --git a/README.md b/README.md index fe7bca6..f48d52a 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,16 @@ The `roaring` library allows you to go back and forth between compressed Roaring ``` +### Goroutine safety + +In general, it not safe to access +the same BitSet using different goroutines--they are +unsynchronized for performance. Should you want to access +a BitSet from more than one goroutine, you should +provide synchronization. Typically this is done by using channels to pass +the *BitSet around (in Go style; so there is only ever one owner), +or by using `sync.Mutex` to serialize operations on BitSets. + ## Implementation Note Go 1.9 introduced a native `math/bits` library. We provide backward compatibility to Go 1.7, which might be removed.