Skip to content

Conversation

@devmotion
Copy link
Contributor

By putting locks around the global dictionaries in DistributedArrays and DistributedArrays.SPMD, and using an Atomic for the ID generation.

While it works, I think conceptually it would be cleaner to store references of remote parts locally, associated with each array, and make use of the reference tracking and garbage collection behaviour of RemoteChannels: https://docs.julialang.org/en/v1/manual/distributed-computing/#Remote-References-and-Distributed-Garbage-Collection As advised in the docs, to reduce memory on the workers in the finalizer of each array we could call finalize on the RemoteChannel.

Copy link
Member

@andreasnoack andreasnoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to file an issue about the alternative implementation, such that it is on record but we should get this one in to resolve the thread safety issue.

@andreasnoack andreasnoack merged commit 9ce4ab4 into JuliaParallel:master Dec 4, 2025
15 checks passed
@devmotion devmotion deleted the dw/locks branch December 4, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants