Skip to content

Commit c587821

Browse files
authored
Update comment about ::Hash on CRuby, it's not fully thread-safe
1 parent 7d58ec8 commit c587821

File tree

1 file changed

+5
-3
lines changed
  • lib/concurrent-ruby/concurrent

1 file changed

+5
-3
lines changed

lib/concurrent-ruby/concurrent/hash.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ module Concurrent
1515
# @!macro internal_implementation_note
1616
HashImplementation = case
1717
when Concurrent.on_cruby?
18-
# Hash is thread-safe in practice because CRuby runs
19-
# threads one at a time and does not do context
20-
# switching during the execution of C functions.
18+
# Hash is not fully thread-safe on CRuby, see
19+
# https://bugs.ruby-lang.org/issues/19237
20+
# https://github.com/ruby/ruby/commit/ffd52412ab
21+
# https://github.com/ruby-concurrency/concurrent-ruby/issues/929
22+
# So we will need to add synchronization here (similar to Concurrent::Map).
2123
::Hash
2224

2325
when Concurrent.on_jruby?

0 commit comments

Comments
 (0)