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

Fix deadlock possibility in threaded load of materials #100363

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented Dec 13, 2024

_is_initialized() checks the initialization state of the material, which is only a concern of the thread that is creating or loading it. Therefore, no locking is needed. Splitting the creation or loading of a material among threads is not supported, also. What's more, locking can lead to deadlocks involving the main thread, as it tries to flush the update list, and loader threads. That's the hazard (seen in practice) this PR avoids.

Version of this PR for 4.3 submitted as #100364.

@Repiteo Repiteo merged commit 5527bcb into godotengine:master Dec 13, 2024
40 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 13, 2024

Thanks!

@RandomShaper RandomShaper deleted the fix_mtl_mt_deadlock_4.4 branch December 16, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants