简体   繁体   English

避免使用boost :: interprocess :: message队列创建文件

[英]Avoid file creation with boost::interprocess::message queue

I am using boost::interprocess::message queue on windows. 我在Windows上使用boost::interprocess::message queue It creates a file in C:\\program data . 它在C:\\program data创建一个文件。 Is there some way i could use a different shared memory than memory mapping like windows_shared_memory . 有什么办法可以使用不同于windows_shared_memory类的内存映射的共享内存。 I came across this but could not find windows_message_queue as part of boost. 我遇到了这个问题,但找不到windows_message_queue作为增强功能的一部分。

My use case is that at some point Process P1 will create a message queue and wait for a message from pocess P2 . 我的用例是流程P1会在某个时候创建​​一个消息队列,并等待来自流程P2的消息。 When P1 receives the message(using timed_receive() ) the message queue is deleted. P1收到消息时(使用timed_receive() ),消息队列被删除。 This will happen a number of times(with different name). 这将发生多次(使用不同的名称)。

Is there some other mechanism which i can leverage here. 还有其他我可以利用的机制。 The main concern is avoiding creating files on user's location. 主要问题是避免在用户的位置上创建文件。

它应该在那里...您尝试过这个包含吗?

#include <boost/interprocess/windows_shared_memory.hpp>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM