-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[Distributed] Remove (now) unnecessary copy of the Future in its serializer #43465
[Distributed] Remove (now) unnecessary copy of the Future in its serializer #43465
Conversation
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.
This now violates thread safety, since it is not holding a lock
I checked this lock placement and it works fine krynju@fb605fa But now I'm thinking and maybe we should only lock when the The lock in serialize is mainly protecting against serializing junk in progress of setting the Future or other consequences of serializing and setting at the same time, so I guess it's fine to skip it when it's already set |
You cannot know that it is not-nothing until you are holding the lock though |
I was thinking of checking for We already check for |
that requires double-checked locking pattern, and the extra complexity is probably not worth it here |
I'll take care of this one in ~a month once I have any free time. |
Actually, looking back, I don't know what |
I think I added what I was talking about here https://github.com/krynju/julia/blob/b2edc754ed6215e27e282e390ac031c4ddca756f/stdlib/Distributed/src/remotecall.jl#L367-L386 Basically I think there might be this one gap where we serialize an unset Future. An unset future can be set during the serialization, so we should probably protect only that case with the lock (the lock is always used when setting the Future). |
This was introduced in #42339 as a workaround in order to safely serialize a
Future
, which now contains alock
But now that #43325 is merged this is no longer necessary