On Mon, 3 Dec 2001, Abramo Bagnara wrote:

> Jaroslav Kysela wrote:
> >
> > On Mon, 3 Dec 2001, Alexander Ehlert wrote:
> >
> > > Hi,
> > >
> > > can it be, that snd_pcm_open in the alsa lib is not threadsafe?
> >
> > You're right, the snd_config_update() function is not thread safe (it uses
> > global variables). I put this item to the todo list.
> >
> > > Glame uses threads for all its plugins and if I have for example
> > > one audio_in and one audio_out plugin, it can happen, that
> > > snd_pcm_open is called twice at the same time. Wonderful things
> > > happen in snd_config_expand and glame can't open any audio devices
> > > with alsa for a running session. Putting mutexes around snd_pcm_open
> > > fixes the problem. Are there any other functions in the alsa lib
> > > that are potentially not thread safe?
> >
> > Other functions should be thread safe (except pcm_share plugin),
>
> Why you say that? pcm_share has been written with multithreading in
> mind.
>
> I've missed something?

Nope. It was my bad assumption, that the global list of clients is not
protected using a mutex. You're right, there shouldn't be any problem with
pcm_share.

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
SuSE Linux    http://www.suse.com
ALSA Project  http://www.alsa-project.org


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

Reply via email to