I’m looking to mimic the very nicely demonstrated xQueueSend() implementation from the documentation.
I’m hoping to clarify my understanding of the above linked demonstration, for the use case of sending a struct pointer to the queue. If the ‘sending’ task is modifying the values of the struct at a relatively high frequency, what is the standard/most performant way to ensure that the struct values aren’t changed between the struct pointer being sent to the queue, and the ‘receiving’ task processing the struct values?
If my understanding is correct, the address of the struct is copied to the queue, so there’s nothing stopping the struct from being altered between sending and receipt/processing of the struct’s address.
I tend to use task notifications wherever possible, but would this be a situation where a binary semaphore would have to be used? If so, consideration would need to be made to ensure the ‘receiving’ task processes the queue as quickly as possible, to prevent any lengthy blocking of the ‘sending’ task from updating the struct?
Any clarification would be greatly appreciated!