Actions
Feature #22139
openProhibit `END{}`/`Kernel#at_exit` in non-main Ractor
Feature #22139:
Prohibit `END{}`/`Kernel#at_exit` in non-main Ractor
Status:
Open
Assignee:
-
Target version:
-
Description
Let's prohibit END{}/Kernel#at_exit on non-main Ractor.
The current behavior is strange:
Ractor.new{
at_exit{ p [self, Ractor.current] }
}
sleep 1
#=> [#<Ractor:#2 t.rb:2 terminated>, #<Ractor:#1 running>]
There are some options:
- prohibit them. Simple.
- invoke the block at the end of the Ractor.
- invoke the block at the end of the process on main Ractor. It is similar idea of the current behavior.
2 is rejected clearly by Matz because of the semantic gap with current behavior.
3 is no problem because the block and reachable objects from the block can be inherited to main Ractor.
However, to make it simple, now let's prohibit them (1), and revisit if we found the (3) is needed.
Updated by ko1 (Koichi Sasada) 1 day ago
Actions