Queue Urgent question

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Thu Sep 29 15:12:49 UTC 2005

leonp at plris.com wrote:
> Hello, all.
> Stupid question: I have FIFO queue (for 100 messages) which contains, let's 
> say, 2 messages m1 and m2 in it (receiving task is suspended). Then I do 
> rtems_message_queue_urgent(m3 ...) and resume the receiving task.
> I expected the m3 message to arrive the first, but I see the sequence
> m1, m2, m3.

Without looking at code, if the receiving task is blocked on the 
queue_receive, then when m1 is sent, it is immediately given to the
task and not enqueued.   Even if the receiver is suspended.

 From your description, I can't tell why the other two would not
show up in m3, m2 unless it is running or there are multiple receivers.

Given your description and assuming no other receivers:

   - m1 directly to receiver
   - m2 should be enqueued as only message pending
   - m3 should be prepended to pending messages

Do you have a small test case?

> Any hint will be highly appreciated.
> My rtems is rtems-ss-20030703.

This code would not have changed since then. :)

Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

More information about the users mailing list