Java和C ++共享内存 [英] Java and C++ Shared Memory

查看:712
本文介绍了Java和C ++共享内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++代码片段创建共享内存。是否可以编写Java代码,它可以读取由C ++代码创建的内存,除非使用JNI。

I have a C++ piece of code that creates shared memory. Is it possible to write Java Code which can read the memory created by the C++ code unless using JNI. By the way I am using Windows OS.

推荐答案

请参阅MappedByteBuffer。它是标准的Java类读取&写共享内存。我用了很多。是的,你可以使用它来与任何使用共享内存的任何语言编写的程序通信,它是非常标准的Java,没有JNI。

See MappedByteBuffer. It's the standard Java class to read & write shared memory. I use it a lot. Yes, you can use this to communicate with any program written in any language which uses shared memory, and it's all very standard Java, no JNI.

这篇关于Java和C ++共享内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆