Add a todo about backing rwlocks with a spinlock

This commit is contained in:
Robbert van der Helm
2021-12-29 15:44:32 +01:00
parent 9a844b387e
commit dad3645156
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -222,6 +222,11 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
* 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;
+5
View File
@@ -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;