Image Gradient: Switch to shared_mutex (#6558)

* Improve lock contention by switching to a shared_lock.
ImageGradient is accessed via a many-reader-one-writer pattern, so a shared_lock causes less contention in the common "read" case.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Remove chatty profile marker.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2021-12-23 14:16:22 -06:00
committed by GitHub
parent f1a1cb3ec0
commit 3e9b76cdee
3 changed files with 8 additions and 10 deletions
@@ -94,6 +94,6 @@ namespace GradientSignal
private:
ImageGradientConfig m_configuration;
LmbrCentral::DependencyMonitor m_dependencyMonitor;
mutable AZStd::recursive_mutex m_imageMutex;
mutable AZStd::shared_mutex m_imageMutex;
};
}