I have two .net applications that run on the same machine. The first application is the 'Engine'. It builds images - image's size is about 4M. The second applications is the 'Viewer'. It shows the images which the 'Engine' sends. The engine sends images every 10-15 seconds.
My question is what is the bast way to pass the images from the engine to the viewer. Currently, I'm using FileSystem for this. The Engine writes the image to file system folder and the viewer getting this file using FileSystemWatcher.
Is that approach ok? Is that reliable?
Android uses the action ACTION_SEND to send data from one activity to another, even across process boundaries. You need to specify the data and its type. The system automatically identifies the compatible activities that can receive the data and displays them to the user.
SSD and HDD drives via SATA cables You can connect your old hard drive to a SATA SSD or eSATA (an external SATA) port in your new computer. After you install the old drive, the operating system in your new PC will read the drive and begin transferring the data over [2].
Since .NET Framework 4.0 you can use Memory Mapped Files for this, I believe it would be faster than file system based approach since you do not need expensive file system IO operations.
A memory-mapped file contains the contents of a file in virtual memory. This mapping between a file and memory space enables an application, including multiple processes, to modify the file by reading and writing directly to the memory. Memory-mapped files can be shared across multiple processes. Processes can map to the > same memory-mapped file by using a common name that is assigned by the process that created the file
So to share MMF across multiple processes you just need to share a MMF name, so you can consider following approach:
Useful links:
"is the most efficient way for multiple processes on a single machine to communicate with each other"
. Basically it show that all other IPC options are MMF-based. (From the mentioned above article) If we check other IPC methods we can see the following architecture:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With