OS: vxWorks 7 22.09
Boost Library Version: 1.75
Protect Type: RTP
I'm working on boost::interprocess::message_queue to establish IPC between two RTPs.
What's A Message Queue?
A message queue is similar to a list of messages. Threads can put messages in the queue and they can also remove messages from the queue. Each message can have also a priority so that higher priority messages are read before lower priority messages. Each message has some attributes:
A priority.
The length of the message.
The data (if length is bigger than 0).
I'm planning to use try_send API.
bool try_send(const void * buffer, size_type buffer_size,
unsigned int priority);
I wish to know what is the scheme used to denote higher priority and lower priority.
Is 0 - MINIMUM(unsigned int) is said to have the highest priority or 4294967295 - MAXIMUM(unsigned int) is said to have the highest priority.
The POSIX standard specifies a priority numbering scheme in which higher priorities are indicated by larger numbers. The VxWorks native numbering scheme is the reverse of this, with higher priorities indicated by smaller numbers. For example, in the VxWorks native priority numbering scheme, the highest priority task has a priority of 0.
The docs can be taken literally:
The highlighted sentence contains your answer: higher priority messages are read before lower priority messages
In practice this is easily tested, at least on my linux box:
Prints the expectable: