Mark the Gem as Ractor safe#160
Merged
jbourassa merged 4 commits intobytecodealliance:mainfrom Mar 29, 2023
Merged
Conversation
See https://docs.ruby-lang.org/en/master/extension_rdoc.html#label-Appendix+F.+Ractor+support There is no global variable, so no problems. But all objects have to be created inside the Ractor, as none are shareable. I don't know how we could make that work.
jbourassa
approved these changes
Mar 29, 2023
Collaborator
jbourassa
left a comment
There was a problem hiding this comment.
Awesome, thanks!
Conceptually I think we could make the Module and the Engine Ractor-shareable without too much trouble, but I haven't given it much thought.
Contributor
Author
|
EDIT: Well no... what was I thinking. Store cannot be shared. |
ianks
added a commit
that referenced
this pull request
Mar 31, 2023
* main: Update all Ruby packages with `bundle update` Update all cargo packages with `cargo update -p` Update Wasmtime Lint Engine Test multiple Ractors at once Replace Engine refcell with a mutex Fix potential GC bug when expiring the caller Allowing making Module and Engine Ractor shareable Mark the Gem as Ractor safe (#160) use Magnus macros to implement TypedData trait
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just need to call
rb_ext_ractor_safeininit.An extension is Ractor safe if it has no global variables.
See https://docs.ruby-lang.org/en/master/extension_rdoc.html#label-Appendix+F.+Ractor+support
Note that all objects have to be created inside the Ractor, as the engine, store, etc. are not shareable (yet?). But it works!