如何在 C++ 中创建一个将在特定路径上分配的队列?
我将 ramfs 安装在/mnt/ram/上,这是一个 RAM 文件夹而不是磁盘,并且希望队列在那里,这样性能会比队列分配在磁盘上更好。
队列是c++的队列库,即:
#include <queue>
queue<string> requestsqueue;
谢谢
最佳答案
block 引用>How do I create a queue in c++ that will be allocated on a specific path?
你不能。
block 引用>The queue is of the queue library of c++,that is:
#include <queue> queue<string> requestsqueue;
标准队列数据结构,
std::queue
,仅存在于内存中。它与任何磁盘文件、文件系统中的任何路径都没有特定的关系。
关于c++ - C++ 在磁盘上的特定位置创建队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13036280/