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?
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
You could use a named pipe to transfer the data between applications.
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
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.