It would be useful for future versions of FreeRTOS to support Queue Sets in a way that would allow adding the same object (Queue or Semaphore) to more than one QueueSet. Currently this is impossible. I recently worked on a project where this feature would allow me to reduce number of necessary threads by one, because with this possibility, I would have been able to implement communication stuff for serial interface, receive and send functions, in only one thread, but without it, I ended up with two – separate threads for RX and TX.
Hi - thanks for the suggestion. It would need some considering to see how to implement that. I suggest opening a feature request in git so it doesn’t get lost.
The problem is that “Queue Sets” are implemented with a Queue that has a message put on when one of the queues in the set has an operation to do. If I queue is put in multiple sets, then the notification would be put in multiple queues, and then when those notifications are taken from each of the queues, two requests from that queue would happen, for just a single item on the queue.
This could work if it was defined that the QueueSet might give notifications for items on a Queue that ended up not being available.
An alternate method might be to use an EventGroup to notify of data availability, where tasks first check if data is available on the queues, and then block on the group to wait for more data.
I opened feature request on GitHub for this functionality. As for use of EventGroup, it should work, but then in addition to Queues with TX/RX data, one will need to create and manage additional Event Group object.
This request appears to be similar to the issue I raised in the faeture wish thread:
Unfortunately, that seems to never have made it onto the “official” list. Oh well.