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

layers: Use concurrent_ordered_map for state objects #3647

Merged

Conversation

jeremyg-lunarg
Copy link
Contributor

Use the thread safe unordered_map for all state objects. This makes
it safe to call Add<>(), Get<>() or Remove<>() without holding a
lock. Note that because Get<>() returns a shared_ptr to the state
object, it will not be deleted while the caller holds this reference.

This does make iterating all state objects even more expensive, but
that was already a bad thing to do anyways.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 9149.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 5810 running.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 5810 failed.

Use the thread safe unordered_map for all state objects. This makes
it safe to call Add<>(), Get<>() or Remove<>() without holding a
lock. Note that because Get<>() returns a shared_ptr to the state
object, it will not be deleted while the caller holds this reference.

This does make iterating all state objects even more expensive, but
that was already a bad thing to do anyways.
@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 9270.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 5812 running.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 5812 passed.

Copy link
Contributor

@mark-lunarg mark-lunarg left a comment

Choose a reason for hiding this comment

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

LGTM.

@jeremyg-lunarg jeremyg-lunarg merged commit 65975ed into KhronosGroup:master Jan 4, 2022
@jeremyg-lunarg jeremyg-lunarg deleted the jeremyg-concurrent-objmap branch January 4, 2022 16:23
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.

None yet

3 participants