Queue Urgent question

leonp at plris.com leonp at plris.com
Thu Sep 29 16:04:24 UTC 2005


On Thursday, 29 בSeptember 2005 18:12, Joel Sherrill <joel at OARcorp.com> wrote:
> 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?
Sorry, no - this is the part of the whole application of about 400Kb code.
All I can add that in reality the situation is worse - I have about 10-12 
messages in the queue when the urgent message is sent, but it is received as 
if it is not urgent.
The receiving task is blocked for sure and there are no other receivers. When 
the receiver is unblocked, it stores messages from the queue (which are with 
time stamps also) one by one into the file and there is no sequence or time 
interruption - urgent message is stored the last with its youngest time tag.
While I wanted it to be stored first.

May be I missed something in FIFO queue definitions?

> > Any hint will be highly appreciated.
> > My rtems is rtems-ss-20030703.
>
> This code would not have changed since then. :)

-- 
Leon M.Pollak



More information about the users mailing list