[英]How to put shared memory between c++ and matlab process?
I have separate matlab and Qt c++ program. 我有单独的matlab和Qt c ++程序。 is it possible that we can share memory between these two.
我们是否有可能在这两者之间分享记忆。 So easily one program can write and other can read with mutex.
因此,一个程序可以轻松编写,其他程序可以使用互斥锁读取。
You can share memory easily using a memory mapped file. 您可以使用内存映射文件轻松共享内存。 See
memmapfile
in MATLAB and Boost's Memory Mapped File library for C++. 请参阅MATLAB中的
memmapfile
和C ++的Boost 内存映射文件库 。 However, it doesn't provide shared mutexes. 但是,它不提供共享的互斥锁。
An alternative is to create a mex wrapper around C++ Boost shared memory operations on the MATLAB side. 另一种方法是在MATLAB端围绕C ++ Boost共享内存操作创建一个mex包装器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.