You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In planning ahead to the near future when TruffleRuby can run C-extensions marked with rb_ext_ractor_safe(true) in parallel, and for when Ractors are no longer just experimental, it would be great if the C-extension could be made Ractor-safe, or marked as such if it already is so!
Activity
[-]Make C-extension threadsafe/Ractor-safe[/-][+]Make C-extension Ractor-safe[/+]eregon commentedon Sep 18, 2024
I took a look at https://github.com/bcrypt-ruby/bcrypt-ruby/blob/master/ext/mri/bcrypt_ext.c.
The only global variables there are assigned once during the Init_ function, so there is simply no global state.
So that seems safe to mark as Ractor-safe.
Docs about rb_ext_ractor_safe: https://github.com/ruby/ruby/blob/master/doc/extension.rdoc#appendix-f-ractor-support-