hero79
October 25th, 2005, 01:45 AM
Hi all,
i`m searching for linux c functions or library, where i can create shared memory used by application, that can survive application crash and when application is restarted, then this application can access this memory.
Is this possible ?
SuperKoko
October 25th, 2005, 06:41 AM
You can do that by creating a small process which will contain the data.
This process must be a little stable executable.
This process will communicate with the application through COM, or a pipe, or window messages, or any interprocess communication technique.
This process will be created, if not already existing, on application's startup.
If it already exists, the application will use this process to get the data.
This process will not be exited when the main application crashes.
You can optionally, exit or not, the process, when the main application exits properly, depending whether you want, or not, get the data at the next application startup.
If you want to support unexpected PC crash and reboot, you'll need to save the data in a file.
I am not sure, but a file mapping may also be used (in that case, the second process is not necessary). I suppose that the file map is saved to the file if the process crashes, but I'm not sure.