[LAD] Best practice for sharing complex data structures with a jack callback function

Fons Adriaensen fons at kokkinizita.net
Sat Jul 7 09:25:12 UTC 2007


On Fri, Jul 06, 2007 at 10:13:36PM -0500, Jack O'Quin wrote:

> Beware!  Flags are not enough to guarantee that you get
> a coherent copy of the structure.  The safest technique is
> using "guard" words at the start and end of the structure.
> ...

Depends on how they are used.

If the callback unconditionally updates the data each
time it runs then you are right. 

If the system is that ownership of the struct is trans-
ferred between the two parties and only the owner ever
writes, then a simple flag will do.

Ciao,

-- 
FA

Follie! Follie! Delirio vano è questo !





More information about the Linux-audio-dev mailing list