Can I use shared memory on Windows in order to have a common memory region that can be used by multiple separate processes?
Context:
Porting a unix application to Windows which has: - a 'setup' process that creates a number of shared memory regions. - a set of other processes (that run at times when the setup process has already finished) that read (and occasionally write) the memory regions that have been prepared by the setup process
I have already experimented with CreateFileMapping(INVALID_HANDLE_VALUE, ...)/OpenFileMapping
but the shared memory seems to be freed as soon as the creating process exits.
Should I create real (i.e. on file system) files and open these instead of using INVALID_HANDLE_VALUE
?