Skip to content
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

[9/n][vm-rewrite][Move] Update depth calculation calculation/caching to be threadsafe #21074

Open
wants to merge 1 commit into
base: tzakian/vm-rewrite-adapter-8
Choose a base branch
from

Conversation

tzakian
Copy link
Contributor

@tzakian tzakian commented Feb 3, 2025

Switching the depth calculation of types to be lazily evaluated when we first encountered the value, coupled with shared package cache, and the types living in this shared package cache meant that the depth for a type needed to be made threadsafe since we may need to write to it in a parallel context.

This does this by RwLocking the depth field and then making the changes from there.

@tzakian tzakian requested a review from cgswords February 3, 2025 21:28
Copy link

vercel bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 4, 2025 8:40pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 8:40pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 8:40pm

…to be threadsafe

Switching the depth calculation of types to be lazily evaluated when we
first encountered the value, coupled with shared package cache, and the
types living in this shared package cache meant that the `depth` for a
type needed to be made threadsafe since we may need to write to it in a
parallel context.

This does this by `RwLock`ing the `depth` field and then making the
changes from there.
Copy link
Contributor

@cgswords cgswords left a comment

Choose a reason for hiding this comment

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

LGTM

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