-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
allow to access ivars of classes/modules #5006
Conversation
f7bd109
to
9e358e4
Compare
if an ivar of a class/module refer to a shareable object, this ivar can be read from non-main Ractors.
prelude: |
class C
@a = 1
def self.a
_a = @a; _a = @a; _a = @a; _a = @a; _a = @a;
_a = @a; _a = @a; _a = @a; _a = @a; _a = @a;
end
end
benchmark:
vm_ivar_of_class: |
a = C.a
loop_count: 30000000
This patch makes ivar of class x1.15 slower. I think it is acceptable.
|
benchmark for a class's ivar setter
setter is x1.06 slower. |
9e358e4
to
5613369
Compare
doc/ractor.md
Outdated
|
||
Otherwize, only the main Ractor can access instance variables of shareable objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwize, only the main Ractor can access instance variables of shareable objects. | |
Otherwise, only the main Ractor can access instance variables of shareable objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
7523c9c
to
3fec10a
Compare
if an ivar of a class/module refer to a shareable object, this ivar
can be read from non-main Ractors.