We have a vxWorks design which requires one task to process messages from two message queues, Q1 & Q2.
We would like to wait on both Queues and whichever gets a message, process the message from the queue.
We want to avoid either polling the queues or using a timeout value which could cause the other queue to fill up.
Is there a way to do this?
If you use named pipes (pipeDevCreate(), write(), read()) instead of message queues, you can use select() to block until there are messages in either pipe.
Whenever select() triggers, you process all messages in the high priority pipe. Then you process a single message from the low priority pipe. Then call select again (loop).
Example Code snippets: