Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c587821

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

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
  • lib/concurrent-ruby/concurrent
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

‎lib/concurrent-ruby/concurrent/hash.rb

Copy file name to clipboardExpand all lines: lib/concurrent-ruby/concurrent/hash.rb
+5-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.