Question

While using the POSIX Message queues I noticed there were some files being created on the File system with the name I was creating the queues. My questions :

Q1. Do message queues queue up the messages on the Hard Disk and not RAM ?

Q2. If so, shouldn't this be very slow in implementation as it involves HardDisk ?


Edit:

I read this in the book The Linux Programming Interface :

On Linux, POSIX message queues are implemented as i-nodes in a virtual file system, and message queue descriptors and open message queue descriptions are implemented as file descriptors and open file descriptions, respectively. However, these are implementation details that are not required by SUSv3 and don’t hold true on some other UNIX implementations.

Even if it is VFS, it is still stored on the HardDisk, right ?

With this information in mind, can someone comment on the second question now ? (and / or First one also if there is something more to add)

Was it helpful?

Solution

Below link may give some clarity on first question http://man7.org/linux/man-pages/man7/mq_overview.7.html

Regarding second question, of course the file based queue will be slower than memory based one. But this may not be as slow as some random file access operations since it is optimized and implemented specific for queuing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top