From dad36451560179c1cb18a62d995a9458a0596398 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 29 Dec 2021 15:44:32 +0100 Subject: [PATCH] Add a todo about backing rwlocks with a spinlock --- src/plugin/bridges/vst3.h | 5 +++++ src/wine-host/bridges/vst3.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/plugin/bridges/vst3.h b/src/plugin/bridges/vst3.h index d4375858..5a5cf424 100644 --- a/src/plugin/bridges/vst3.h +++ b/src/plugin/bridges/vst3.h @@ -222,6 +222,11 @@ class Vst3PluginBridge : PluginBridge> { * anything weird even without locks, but we'll still prevent adding or * removing instances while accessing other instances at the same time * anyways. See `Vst3Bridge::object_instances_mutex` for more details. + * + * TODO: At some point replace this with a multiple reader single writer + * lock based by a spinlock. Because this lock is rarely contested + * `get_proxy()` never yields to the scheduler during audio + * processing, but it's still something we should avoid at all costs. */ std::shared_mutex plugin_proxies_mutex; diff --git a/src/wine-host/bridges/vst3.h b/src/wine-host/bridges/vst3.h index 2963192f..0191f859 100644 --- a/src/wine-host/bridges/vst3.h +++ b/src/wine-host/bridges/vst3.h @@ -520,6 +520,11 @@ class Vst3Bridge : public HostBridge { * other plugins on different threads. Since the lock should never be * contested, we should also not get a measurable performance penalty from * making double sure nothing can go wrong. + * + * TODO: At some point replace this with a multiple reader single writer + * lock based by a spinlock. Because this lock is rarely contested + * `get_instance()` never yields to the scheduler during audio + * processing, but it's still something we should avoid at all costs. */ std::shared_mutex object_instances_mutex;