I'm wondering if I can start of a bit of a discussion.
I'm in the process of writing a little example plugin which I think will be useful for a few folks using JUCE for drawing Filter Displays utilising Vitrual Analogue filter transfer functions.
Whilst doing this I've thought about adding metering etc. I understand the basic concepts behind lock-free FIFO's (single reader and writer) and am slowly building on my knowledge of lock free concurrent data structures and message passing.
However the only method that I have been capable of so far is updating VU style meters with an FIFO which is polled / read by the editor within a timer call back. Various forum threads and sources have stated what a mess polling is and people like TheVinn have explained the proper approach of an aynchronous singalling technique along with a lock free queue for data tansfer.
My question is can anyone shed some light on an approch for sending an asynchronous signal / update message between threads ? This will most likely need to be done from the processBlock in some manner. I know that the AsyncUpdater class invoked malloc so this is a no go for correct lock-free code(VFLib does deal with this issue I believe). Basically I need to send a change message of some description (Asynchronously without any memory allocation) to wake up a function in my Editor which will read data from the lock-free FIFO being filled by the processBlock and use this data to update meters etc.
My only approach may well be to go with VFLib and use the thread queues but I dont fully understand the library yet and would like to get my head around different techniques for inter thread comms / async signalling before using any libraries blindly.
Any help / words of wisdom on this topic woud be greatly appreciated. I appreciate the key word of wisdom may well be "Use a library, don't even go there because correct lock-free concurrency is a climb down the coding rabbit hole". Herb Stutter and many others have hinted at this....