Message queues - Embedded

This is a discussion on Message queues - Embedded ; Hi all, We have a process in embedded linux which posts messages on a message queue. At a later processing stage, the process requires to flush these messages. What is the recommended way of flushing the queue other than reading ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Message queues

  1. Message queues

    Hi all,

    We have a process in embedded linux which posts messages on a message
    queue. At a later processing stage, the process requires to flush these
    messages.

    What is the recommended way of flushing the queue other than reading
    the posted messages in a loop? Our design requires to have waited calls
    on message queues. Reading the messages in a loop will eventually block
    the process on the last msgrcv call.

    Please suggest a better way to achieve this on embedded linux.

    Thanks
    rtos


  2. Re: Message queues

    >
    > What is the recommended way of flushing the queue other than reading
    > the posted messages in a loop? Our design requires to have waited calls
    > on message queues. Reading the messages in a loop will eventually block
    > the process on the last msgrcv call.


    You could additionally wait on another resource or use a signal to
    prevent blocking.

    Perhaps you can delete the queue and recreate it to unload the messages.

    -Michael

+ Reply to Thread