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

[gl] reorder program_cache & context lock acquisition #5870

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

teoxoy
Copy link
Member

@teoxoy teoxoy commented Jun 24, 2024

We are using program_cache.try_lock() when creting pipelines which is covered by a guard gotten from context.lock(). For the .try_lock() to always succeed we need to make sure that the other lock acquisitions are also covered by a context.lock().

The wgpu_examples::hello_compute::tests::multithreaded_compute test has been failing intermittently in CI due to this (recent example).

Follow-up to #3380, relevant discussion: #3380 (comment).

We are using `program_cache.try_lock()` when creting pipelines which is covered by a guard gotten from `context.lock()`. For the `.try_lock()` to always succeed we need to make sure that the other lock acquisitions are also covered by a `context.lock()`.

The `wgpu_examples::hello_compute::tests::multithreaded_compute` test has been failing intermittently in CI due to this.
@teoxoy teoxoy requested a review from a team as a code owner June 24, 2024 09:54
Copy link
Member

@ErichDonGubler ErichDonGubler left a comment

Choose a reason for hiding this comment

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

Approving, but: Shouldn't @jimblandy's rules for lock ordering be updated with this, too? 🤔

@teoxoy
Copy link
Member Author

teoxoy commented Jun 24, 2024

The rules are for the locks in wgpu-core; these locks are in the GL hal backend.

@teoxoy teoxoy merged commit 333ed78 into gfx-rs:trunk Jun 24, 2024
25 checks passed
@teoxoy teoxoy deleted the reorder-locks branch June 24, 2024 14:57
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