Private Message Queue - Threadsafe?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Private Message Queue - Threadsafe?

431 Views
johannestraxler
Contributor III

Hello,

I have 4 senders and only 1 receiver in my application, so I want to realize some sort of mailslot where I have N senders and 1 receiver.

Is it possible to realize this with only one message queue, that is created (with _msgq_open()) in the receiver and shared as extern variable with the other tasks or do I need one separate message for every task --> 4 + 1 = 5 message queues?

When I refer to chapter "3.7.7.6 Using Private Message Queues to Receive Messages" of MQX-UG Rev. 3 it says:

"A task can send a message to any private message queue, but only the task that opened a private message

queue can receive messages from it. Only one task at a time can have the private message queue open."

So I guess it should work with only one message queue object. What is your opinion?

BR Johannes

0 Kudos
0 Replies