From: Takashi Iwai Subject: Re: Should snd_pcm_drop() interrupt snd_pcm_writei() call? Date: Fri, 15 May 2009 17:30:20 +0200 Message-ID: References: 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 mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 35A171039E6 for ; Fri, 15 May 2009 17:30:20 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Marek Peca Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 15 May 2009 16:28:06 +0200 (CEST), Marek Peca wrote: > > >> This explains the problems I encountered. I missed the information, that > >> these functions are not meant to be thread-safe. > > > > Although it's not recommended, the behavior you described sounds strange. > > Could you check whether this still happens with the very latest > > alsa-lib version? > > Yes, we will try to, but I need some cooperation with colleague, so it > will take some time. > > > Also I guess this depends on the plugin to be used, e.g. dmix or not. > > I see. Please, can you tell me, whether I should rewrite my program to > purely single-thread acces to snd_pcm_write & snd_pcm_drop, or should I > expect, that in ALSA (with proper plugin) it should work in correct > releases? A safer option is the single thread access if you want your app to support many different systems including old ALSA. In addition, you could add a different approach depending on the version, e.g. by checking in configure script. Anyway, checking with the latest version is helpful for us ;) thanks, Takashi