I am using xQueueSendToBack to write to a queue using portTICK_PERIOD_MS so it will wait forever because by design it will eventually be serviced. When the queue fills this task will block. However, what about the case where several tasks are sending to this same queue? Do they all safely block one after the other as they post? Do they unblock in post order as the queue becomes free?
Many thanks,
Ron Kreymborg
First, if you want to wait ‘forever’ use portMAX_DELAY, not portTICK_PERIOD_MS.
If multiple tasks try to write to a queue that is full, they will block, and will succeed in priority order, not the order they attempted to write in. I believe that if they have the same priority, they will succeed in the order they attempted, but I am not positive on that. That would follow the general principle that in the same priority, the one waiting the longest tends to go next for the round robin scheduler.
Thanks Richard. That would make sense. I’ll be implementing this so will post if I find anything different.
Regards, Ron
I would recommend taking a look at the book - it is a bit out of date but the description of the queues is still valid https://www.freertos.org/Documentation/RTOS_book.html