Hi,
Is there an easy way to allow any child task to receive messages from a private message queue? The code was orginally written as if the queue ID was enough information to access the messages on the queue.
Example
'Main_Task' creates pool / queue to the task 'RXI_Task'
'Main_Task' calls various functions which get data via the message queue to 'RXI_Task'
'Main_Task' then creates several child tasks which can call the same functions called from 'Main_Task', these functions get the data via 'RXI_Task' queue. The problem is when these child tasks are created, the message queue ID is no longer enough to get the messages from 'RXI_Task', only 'Main_Task' can access those messages.
There is a mutex protecting the functions from multipule tasks trying to access the msgq.
Do i have to rewrite this? or is there some other way?
Hi Carl,
Are you closing(with your Main Task) and reopening the Message Queue with the child task trying to receive the message?
Remember that Only the task that opens a private message queue can receive messages from the queue.
And just a small question, if you are protecting the msgq with a mutex, should we protect message pools
with mutex too? I thought MQX protected this functions by default?
msg_ptr = (GENERIC_DATA_MSG_PTR)_msg_alloc(mp_QuadSPI);
If different priority tasks have calls to the instruction above, should we use Mutex to prevent simultaneous access?
Regards,