I would like to create a system that utilizes shared memory
to do interprocess communication. I would also like to
allow whichever process is the first to execute to create
the shared memory and have additional processes first
attempt to create, but then just attach when it realizes
the file mapping handle already existed.
I am concerned, however, about 2 applications almost
simultaneously attempting to create the shared memory
region. If CreateFileMapping is an atomic operation, there
won't be a problem. If it isn't, what happens when these
two processes are both attempting to create a shared memory
region with the same name? Is there a potential for race
conditions to occur?
Any insight on this would be much appreciated.
Thank you,
Paul
|