RoaringBitmap / RoaringBitmap/roaring

Expand on "Goroutine safety" section of README

Open
#242 11 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.9k
Forks
262
Avg merge
2h 34m
Merged PRs (30d)
8

Description

It would be great if the Goroutine Safety section of the README.md about what operations are currently goroutine-safe could be expanded on, even/especially if that's not a guarantee that they will remain thread-safe moving forward.

For example, if bitmap rb1 is created, optimized, and never written to again (or has appropriate locking), can it be safely used in concurrent read operations by another bitmap rb2.And(rb1) or rb2.Or(rb1)?

Testing this with go test -race (which I know isn't a anywhere near complete test) doesn't report any issues:

func TestConcurrentBitmapAccess(t *testing.T) {
	rb1 := roaring.BitmapOf(1, 20, 40, 90)

	var wg sync.WaitGroup
	for i := 0; i < 1000; i++ {
		wg.Add(1)
		go func() {
			rb2 := roaring.NewBitmap()
			rb2.And(rb1)
			wg.Done()
		}()
	}
	wg.Wait()
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Goroutine Safety section in README.md and inspect the bitmap operations relevant to the rb2.And(rb1) and rb2.Or(rb1) examples. Run the supplied concurrency example with go test -race, then document which operations are currently safe, including the no-write or locking conditions and whether these are guarantees.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.