pipewire/spa
Wim Taymans 9c19284f7f support: make the loop queue handling lockfree
Don't use TSS to store per-thread queues but keep a lockfree stack of
queues. We can then pick off a queue and write to that one and place it
back after use.

We need to keep the queues indexed by id in the stack because otherwise
we would need to compare-and-swap 128 bits (pointer + tag), which is
more problematic.

Because we keep the queues in an array and no queue is ever removed and
the array can only grow, we can quite easily just iterate the array
without a lock. Without the lock we also fix one of the potential
problems with ardour where the queue_flush thread is canceled while
flushing and the queue_mutex remains locked.

Because we end up with all queues in the array now, we can overflow the
fixed max amount of queues we can manage. When that happens, sleep for a
while and try again. This is a case where more than QUEUES_MAX (128) threads
are invoking at the same time and is rather unlikely.

There is also the queue overflow case which we now also must handle with
a retry. This potentially uses more eventfds but again this should be
unlikely and cause no further problems.

See #4356
2024-11-04 17:41:14 +01:00
..
examples Port videotestsrc to LoopUtils 2024-07-01 15:28:14 +00:00
include json: improve infinite checks 2024-10-23 15:37:07 +02:00
include-private/spa-private spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
plugins support: make the loop queue handling lockfree 2024-11-04 17:41:14 +01:00
tests Add GNU/Hurd support 2023-09-24 15:11:52 +00:00
tools spa: add spa_json_object_next 2024-09-16 09:50:36 +02:00
meson.build require newer alsa 1.2.10 for UMP support 2024-07-30 10:06:41 +02:00