[documentation] Concurrent::Set documentation is ambiguous, possibly misleading. #900
Labels
bug
A bug in the library or documentation.
high-priority
Should be done ASAP.
looking-for-contributor
We are looking for a contributor to help with this issue.
The docs for
Concurrent::Set
state (emphasis mine)However, on CRuby, the implementation of
Concurrent::Set
is just the built-inSet
(ref).Clearly, the built-in set does not perform any locking around method calls. This caused a few bugs for me when I used
Concurrent::Set
it for sharing state between threads. I had one thread iterating the set with#each
and other threads adding/deleting items from the set. This failed, since CRuby Set doesn't support mutating a set during iteration.Would a PR updating the docs to call this out explicitly be welcome? I would propose something like:
The text was updated successfully, but these errors were encountered: