[LAD] Synchronizig arg update in callback and process in main function

Benny Alexandar ben.alex at outlook.com
Mon Jan 15 15:46:50 UTC 2018


Hi,

I have registered process callback and also a pointer to data struct as arg parameter.
Whenever callback happens this arg is typecasted to data struct, and update the data struct.

For eg every 20ms process callback happens and updated the data struct arg,
and every 100ms  main function reads the data struct. While reading  and processing
the data process callback can happen and update it.

How to make sure when main function is reading data struct the process callback is not updated,

or any other ways to synchronize these two ? Any example app for this.

-ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20180115/1b59686d/attachment.html>


More information about the Linux-audio-dev mailing list