Message queues

Jun 13, 2006 1 Replies

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



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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required