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