[#122258] [Ruby Misc#21367] Remove link to ruby-doc.org from www.ruby-lang.org/en/documentation/ — "p8 (Petrik de Heus) via ruby-core" <ruby-core@...>
Issue #21367 has been reported by p8 (Petrik de Heus).
11 messages
2025/05/23
[ruby-core:122102] [Ruby Bug#21037] Ractors hang with multiple threads
From:
"luke-gru (Luke Gruber) via ruby-core" <ruby-core@...>
Date:
2025-05-14 17:02:30 UTC
List:
ruby-core #122102
Issue #21037 has been updated by luke-gru (Luke Gruber).
I didn't tag the commit message properly, but this can be closed. PR https://github.com/ruby/ruby/pull/12633 was merged. Thanks!
----------------------------------------
Bug #21037: Ractors hang with multiple threads
https://bugs.ruby-lang.org/issues/21037#change-113255
* Author: tenderlovemaking (Aaron Patterson)
* Status: Assigned
* Assignee: ractor
* ruby -v: ruby 3.5.0dev (2025-01-14T20:59:39Z master f1e32914eb) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The following program hangs, but I don't expect it to hang:
```ruby
# frozen_string_literal: true
class Map
def initialize
@r = Ractor.new {
cache = { "int" => "integer", "bool" => "boolean" }
loop do
key = receive
Ractor.yield key
end
}
freeze
end
def fetch(key)
@r.send key
m = @r.take
raise unless key == m
m
end
end
tm = Map.new
t1 = Thread.new { 10.times { |i| p [i + 1,tm.fetch("int")] } }
t2 = Thread.new { 10.times { |i| p [i + 1, tm.fetch("bool")] } }
t1.join
t2.join
```
I'm not sure why this program hangs yet, but it does both on macOS and Linux. I've tested with master, Ruby 3.4, and Ruby 3.3. I'm not sure why it's hanging yet, but I wanted to file an issue.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/