Search code examples
c++linuxqueueramalloc

create a queue in a specific location on the disk c++


How do I create a queue in c++ that will be allocated on a specific path?

I mounted ramfs on /mnt/ram/ which is a RAM folder rather than a disk , and would like the queue to be there, so the performance would be better than if the queue were allocated on the disk.

The queue is of the queue library of c++,that is:

#include <queue>
queue<string> requestsqueue;

Thanks


Solution

  • How do I create a queue in c++ that will be allocated on a specific path?

    You can't.

    The queue is of the queue library of c++,that is:

    #include <queue>
    queue<string> requestsqueue;
    

    The standard queue datastructure, std::queue, exists only in memory. It has no particular relationship to any disk file, nor to any path in the file system.