tags:

views:

80

answers:

1

.Net 4 will have a brilliant support for memory mapped files. The two main applications listed on different blogs (http://blogs.msdn.com/salvapatuel/archive/2009/06/08/working-with-memory-mapped-files-in-net-4.aspx) are:

1) editing large files,

2) interprocess communication.

I'm already using WCF over named pipes for interprocess communication.

Can someone please explain to me/provide some example how I can achieve similar functionality using memory mapped files? For instance, I want to call a single method from one process which will be executed in another process and the results are "sent"/available in the calling process.

+2  A: 

With IPC you have to serialize/deserialize data before passing it around each time you call a method. With MMF you'll still use IPC for notifications, however you will no longer pass serialized data around but memory handles instead. This can provide a significant performance boost with large data, as you save serialization/deserialization time and space.

fbonnet
OK, so if I correctly understand, I'll have to use hybrid approach. I'm just curious how IPC/WM_ messages are using MMF to provide event-based model. According to Microsoft sockets, pipes, OLE, etc. are all based on MMFs.
Karol Kolenda