Skip to content

fix: replace lru_cache with singleflight_cache for dynamic model creation for multi-thread safe#685

Merged
Mini256 merged 1 commit intomainfrom
fix-dynamic-model-creation
May 13, 2025
Merged

fix: replace lru_cache with singleflight_cache for dynamic model creation for multi-thread safe#685
Mini256 merged 1 commit intomainfrom
fix-dynamic-model-creation

Conversation

@Mini256
Copy link
Copy Markdown
Member

@Mini256 Mini256 commented May 13, 2025

The singleflight pattern ensures that for any given set of arguments,
concurrent calls to the decorated function will only result in a single
actual execution. Other threads with the same arguments will wait for
the first execution to complete and then receive the same result,
rather than triggering duplicate computations.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented May 13, 2025

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

Name Status Preview Comments Updated (UTC)
autoflow ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 8:56am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
tidb-ai-preview ⬜️ Ignored (Inspect) May 13, 2025 8:56am
tidb-ai-storybook ⬜️ Ignored (Inspect) May 13, 2025 8:56am

@Mini256 Mini256 merged commit 24a82d5 into main May 13, 2025
10 checks passed
@Mini256 Mini256 deleted the fix-dynamic-model-creation branch May 13, 2025 09:17
NG85 pushed a commit to NG85/autoflow that referenced this pull request May 14, 2025
…tion for multi-thread safe (pingcap#685)

The singleflight pattern ensures that for any given set of arguments,
concurrent calls to the decorated function will only result in a single
actual execution. Other threads with the same arguments will wait for
    the first execution to complete and then receive the same result,
    rather than triggering duplicate computations.
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.

1 participant