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

Make descriptor_cache usable from parallel threads #23

Open
4 tasks
johannesugb opened this issue Jul 31, 2020 · 0 comments
Open
4 tasks

Make descriptor_cache usable from parallel threads #23

johannesugb opened this issue Jul 31, 2020 · 0 comments
Labels
C++ C++-centric task enhancement New feature or request

Comments

@johannesugb
Copy link
Member

johannesugb commented Jul 31, 2020

The avk::descriptor_cache shall be usable from parallel threads. This is partly already prepared by the means of different descriptor_pools being used from different threads (see: std::unordered_map<std::thread::id, std::vector<std::weak_ptr<descriptor_pool>>> mDescriptorPools; and avk::descriptor_cache::get_descriptor_pool_for_layouts).

What needs to be added is a std::mutex that synchronizes access.

  • Add std::mutex to class descriptor_cache
  • Use it in member methods that modify members or access members that could be modified from parallel threads (best synchronize using std::scoped_lock<std::mutex>)

To test this issue, cg-tuwien/Gears-Vk#41 would have to be implemented.

Definition of done:

  • std::mutex-based synchronization has been added to avk::descriptor_cache::get_descriptor_pool_for_layouts.
  • It has been checked if further synchronization is required in the methods of avk::descriptor_cache and if so, the necessary measures have been taken.
  • Usage of the descriptor_cache from parallel threads has been tested (e.g. by using a parallel_invoker)
  • All modified functions/methods are well documented and the Contribution Guidelines have been followed.
@johannesugb johannesugb transferred this issue from cg-tuwien/Auto-Vk-Toolkit Oct 8, 2020
@johannesugb johannesugb added C++ C++-centric task enhancement New feature or request labels Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ C++-centric task enhancement New feature or request
Development

No branches or pull requests

1 participant