[PD-dev] how to not cause audio drops with threads

Tom Schouten doelie at zzz.kotnet.org
Sun Sep 12 00:24:20 CEST 2004


> > > the ring buffer idea is really great and if you don't mind i'll take
> this
> > > over to flext which uses dynamic allocation at the moment.
> >
> > of course not.
> 
> already happened.... it's in the cvs, file flqueue.cpp
>

ok i found it. completely grillified. :)
 
> 
> > so you do use locks in the communication protocol between 2 threads?
> >
> > if so, that's exactly what i'm trying to avoid with this.. in practice it
> > works most of the time for small things, but it's no guarantee to avoid
> > priority inversion. there's interesting stuff about this on the LAD list
> > you know.
> 
> i'll have to read this, but it seems the new flext message passing code will
> work without locks by just depending on head and tail indices to the ring
> buffer (actually there are two ring buffers, one for the atoms passed, and
> one for the metadata)
>

exactly as i meant indeed.
there's one thing about 'volatile' and the read and write indices i'm not
exactly sure about though..






More information about the Pd-dev mailing list