Tool/software: TI-RTOS
Hello,
I have an producer - consumer desing pattern using Mailbox. The Producer (Prio 2.) Mailbox_post(hndl, BIOS_WAIT_FOREVER) messages to the Consumer (prio 6.) task where an MQTT Client task is implemented to send mqtt messages to the broker.
On the producer side I have a for loop without any Task_sleep() calls. When I publish an MQTT message with QOS0 (when only a socket send() is called ), the Producer task is blocked as long as the Consumer send the message, everything works as expected, the Consumer has a higher priority, all is good.
However when I am trying to send a QOS1 message when the send() is followed by recv() to get the PUBACK, the Task scheduler doesn't block the Consumer task, and the Producer iterating to the next loop cycle before getting the PUBACK for its previous transfer.
Q1: What is the reason behid? Can you explaing why is it happening?
Q2: How can I make the Consumer task to wait for recv() to complete and not let the Producer task to resume?
Thank you very much