From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Jaroslav Kysela <perex@perex.cz>
Cc: alsa-devel@alsa-project.org
Subject: Re: locking looks odd
Date: Sat, 20 Aug 2016 14:12:05 +0200 [thread overview]
Message-ID: <20160820121205.GK4252@var.home> (raw)
In-Reply-To: <0fec7ab2-f72f-a27a-e82b-58642836db88@perex.cz>
Jaroslav Kysela, on Wed 17 Aug 2016 19:46:42 +0200, wrote:
> Dne 16.8.2016 v 23:03 Samuel Thibault napsal(a):
> > - snd_pcm_new seems to initialize pcm->thread_safe to 0 by default, this
> > does not seem safe. The attached patch initializes it to 1, which
> > fixes the bug in our tests.
> >
> > - snd_pcm_hw_open_fd forces it to 1, thus ignoring what snd_pcm_new set.
>
> The thread_safe has this meaning:
>
> 0 - the pcm plugin is not thread safe
> 1 - the pcm plugin is thread safe (actually only the hw plugin)
> -1 - disable thread safety
So now with rethinking all of this, I'm starting to understand: from
reading the variable name, I would have thought "thread_safe=1" means
"I want thread safety thanks to a mutex", while apparently it means
"the plugin is already thread-safe, there is no need for a mutex"...
Really, all of this should be documented clearly along the source code,
otherwise people will get it wrong.
I'd just like to check something: do we agree that libasound must be
thread-safe by default (otherwise it breaks the application assumption
that it's thread-safe)? If so, then there are thread-safety bugs: the
mentioned Debian report is far from alone, the upgrade to the newer
libasound has severely broken quite a few applications, I'm at the point
of advising the Debian maintainer to just revert to the previous version
for Stretch, otherwize we'll be shipping just very-buggy software.
Samuel
next prev parent reply other threads:[~2016-08-20 12:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 21:03 locking looks odd Samuel Thibault
2016-08-17 12:41 ` Takashi Sakamoto
2016-08-17 17:46 ` Jaroslav Kysela
2016-08-20 12:12 ` Samuel Thibault [this message]
2016-08-22 12:02 ` Takashi Iwai
2016-08-26 19:02 ` Samuel Thibault
2016-08-30 14:20 ` Takashi Iwai
2016-08-30 15:54 ` Alan Horstmann
2016-08-30 16:00 ` Takashi Iwai
2016-08-22 11:54 ` Takashi Iwai
2016-09-01 6:27 ` David Henningsson
2016-09-01 8:12 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160820121205.GK4252@var.home \
--to=samuel.thibault@ens-lyon.org \
--cc=alsa-devel@alsa-project.org \
--cc=perex@perex.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).