-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using in Ractor #291
Comments
Ractors cannot even do concurrent # c.rb
class C
end
# foo.rb
r1 = Ractor.new do
require './c.rb'
end
r2 = Ractor.new do
require './c.rb'
end
r1.take
r2.take raises
which was reported in https://bugs.ruby-lang.org/issues/19154. As the error says, this is an experimental feature. By now, I am closing. |
To add to this, if you want to use Ractors, you should eager load your application, that's easy to do with Zeitwerk. |
@fxn , @casperisfine thank you! I will try it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ruby 3 introduced Ractor, allowing utilize more than 1 core of CPU.
But when I try use it (make second instance of Rails Application), I got the error:
ruby-3.2.3/gems/zeitwerk-2.6.13/lib/zeitwerk/registry.rb:122:in
loader_for': can not get unshareable values from instance variables of classes/modules from non-main Ractors (Ractor::IsolationError)`Full test code:
Ruby 3.2.3
I don't sure that my approach is correct, but we can create multiple instance of application, it can reduce RAM usage for many applications in the world.
The text was updated successfully, but these errors were encountered: