From: Takashi Iwai Subject: Re: [PATCH alsa-lib v2 0/3] PCM thread-safety patchset Date: Mon, 11 Jul 2016 16:30:08 +0200 Message-ID: References: <20160707144013.23953-1-tiwai@suse.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 233AB26533F for ; Mon, 11 Jul 2016 16:30:09 +0200 (CEST) Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C4D10ABD9 for ; Mon, 11 Jul 2016 14:30:08 +0000 (UTC) In-Reply-To: <20160707144013.23953-1-tiwai@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Thu, 07 Jul 2016 16:40:10 +0200, Takashi Iwai wrote: > > Hi, > > here is a v2 patchset for supporting multi thread safety to alsa-lib > PCM API. Now it's out from RFC and should be reviewed as an official > patchset. > > Basically ALSA PCM functions are thread-unsafe, and applications are > supposed to do the proper protection against racy accesses. The > reality is, however, that application developers don't care such, as > alsa-lib works in most cases. Of course, users still get occasionally > mysterious crashes. > > As a workaround, this patchset adds the pthread mutex protection to > most of exported PCM functions. This is slightly an overkill, but the > biggest merit is that it's easy to implement; I just wrapped the > functions and replaced the internal ones with unlocked versions. > > To be noted, there is an optimization for the direct hw PCM access. > Performance-sensitive applications like JACK should work like before > without any overhead. > > Another bonus by this addition is that we can finally get rid of home > brew (and deadly smelling) atomic macros from the tree, since it's now > more widely protected. > > I lightly tested on my local machines (dmix, PA, jack and plugins) and > all seem working well, so far. As there's been no objection, I pushed this patchset now. Let me know if this gives any regression. thanks, Takashi