Support for non persisted memorymappedfile

2019-09-15 12:40发布

问题:

I want to implement memory mapped file concept as a shared memory to share data between two processes running in my windows system. One in Java and another in native (C# layer).

Both are running processes and hence i want to use non persisted mechanism for memory mapped files instead of persisted file option (because a file poses a security threat ).

Java File Channels http://docs.oracle.com/javase/6/docs/api/java/nio/channels/FileChannel.html#map(java.nio.channels.FileChannel.MapMode, long, long) has an option to map to an existing file.

C# has option to map both a persisted file and a simple alias named map for non persisted file. Please check here https://msdn.microsoft.com/en-us/library/dd997372(v=vs.110).aspx

So i am looking as how i can create a mapping for non persisted mechanism in Java.

Best Regards,

Saurav