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

Reply to
farz
Loading thread data ...

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
Michael Schnell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.