Actions
Bug #19407
open
2 threads taking from current ractor will hang forever
Description
In the current implementation of Ractors, it's possible to take
from the current ractor. This could be useful
when co-ordinating threads:
t = Thread.new do
obj = Ractor.current.take
p obj # do some work with obj
end
t0 = Thread.new do
obj = Ractor.current.take
p obj # do some work with obj
end
Ractor.yield :go
However it hangs forever:
t = Thread.new do
obj = Ractor.current.take
p obj
end
t0 = Thread.new do
obj = Ractor.current.take
p obj
end
sleep 0.5
Should "self-take" be disabled, or was it designed to allow it but this is just a bug?
Updated by hsbt (Hiroshi SHIBATA) over 2 years ago
- Status changed from Open to Assigned
- Assignee set to ko1 (Koichi Sasada)
Updated by jhawthorn (John Hawthorn) about 2 months ago
- Assignee changed from ko1 (Koichi Sasada) to ractor
Actions
Like0
Like0Like0