Skip to content

Make C-extension Ractor-safe #278

Closed

Description

@mohamedhafez

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

  1. changed the title [-]Make C-extension threadsafe/Ractor-safe[/-] [+]Make C-extension Ractor-safe[/+] on Jul 6, 2024
  2. eregon commented on Sep 18, 2024

    @eregon
    Contributor

    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-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions