Data-driven data server for local IPC

I am about to launch an application (s) that needs about 200MB of market data every time it is launched. This is a trivial amount of data to keep in memory these days, so for speed this is what I want to do.

Over the course of a session of days, I might run over and over again, re-run, overwrite and re-run, etc. etc. etc. etc.

SO, the question is how to keep the data in memory all day so that even if the application crashes, I don't have to reload the data by opening the data file on disk and reloading the data?

My initial idea is to write a data server application that does nothing more than read data into shared memory so that it is available for use. If I do this I think I could use memory mapping for IPC by calling

CreateFile ()

CreateFileMapping ()

MapViewOfFile ()

Is there a better IPC / approach?

0


a source to share


2 answers


If you have enough memory and nothing else is required for memory, this can shorten startup time. To guarantee memory access, you probably want to have a memory-mapped file in named shared memory, as described here . You can have a simple program to create and manage a share so that you can ensure that it stays in memory.



+1


a source


Just memory displays the data file. If your computer is not running in memory, the file will remain in the file cache even when the program exits. The next time it starts up, access will be fast.



If your data in memory is different from the data on disk, just use two files. On restart, note the time stamp and version of the file written to the memory file to compare with the disk file so your program will know which one has the most recent data.

+1


a source







All Articles