>I have noticed that ALSA tends to use mutexes a lot
>for its internal locking. Has anyone ever considered
>using rw-semaphores instead? The biggest impact would
>probably be to the /proc filesystem since it would
>allow multiple concurrent readers, but I suppose that
>it might also reduce other contention issues.

what contention issues? almost all the locks in ALSA are per-device
(e.g. per PCM device), so unless you have 2 or more threads accessing
the device at the same time, there is no contention. i haven't seen
any source code that has such a design, and it would be quite odd
given the synchronous nature of audio interfaces. i have seen very,
very little locking that happens at the "top level" of ALSA. am i
missing them?

in addition, its quite a tricky task to work through the code and
decide whether a r-lock, w-lock or mutex is needed at any point in
time, but i suspect that in most cases, a mutex is called for (i.e. we
read and then write the value of a variable).

comments?

--p


_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to