views:

509

answers:

5

For performance purposes I want to write to memory, where an external application can read. I can't link both applications together, so I think the only way is by writing a file. But writing it to a physical disk isn't fast enough. I want to mount a virtual partition so any application can access it. How to do it?

+1  A: 

Check this out.

kek444
DevCon is not redistributable. It is provided for use as a debugging and development tool.
Nifle
Nifle
My application will not be redistributed
Jader Dias
Even if it does, I can ask that people download and install it.
Jader Dias
+1  A: 

I have seen some commersial avaliable ramdisk implementation for .net but I cant seem to find it right now.

Another option might be: http://stackoverflow.com/questions/216083/csharp-accessing-memory-map-file

Nifle
+2  A: 

You could use a named pipe to transfer the data between applications.

dar7yl
+8  A: 

You don't need to go as far as creating a virtual disk to share memory between processes on Windows - you can create a shared memory block, and multiple processes can then access that memory.

See this MSDN article: Creating Named Shared Memory

RichieHindle
+1  A: 

I wish you can use .NET 4.0 :)

.NET 4.0 introduces memory mapped file.

Gunnar Peipman blogged nicely in the following link: .Net Framework 4.0: Using memory mapped files

In his blog, "Memory mapped files are useful when you need to do in-memory data manipulation and your data structures are large. For large in-memory data the performance of memory mapped file is the best. It is much faster than MemoryStream. And like files on hard disc, memory mapped files can be shared between different programs."

His blog also contains the sample code as well.

Chansik Im
Unfortunately it seems that only .NET applications can access such files.
Jader Dias