Open mohamedhafez opened 3 months ago
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-
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!