Hi all,

I am bizy on a project which requires that individual Processes can get to a stack of global variabeles.
So i require a way to share a page, whit other programs. All these programs need to be able to write and read in real-time to and from these Variables, so to and from the shared Page.

What kind of options do have to realize something like that, it needs to be very fast, because the Var's will be used every couple of lines of code.

Thx in advance,

Regards.
PyroMathic
Posted on 2005-04-08 07:49:16 by pyr0_mathic
If I remember correctly you can make use of file mapping for sharing memory.
Posted on 2005-04-08 11:38:40 by roticv
File mapping, or a shared section in your exe or a dll if it's two different .exe's
Posted on 2005-04-08 15:40:07 by f0dder
thx, for the replies.

i looked the thing about the shared section in the dll's up, but that also uses the CreateFileMapping api, for as far as i can see.

But is there then a way to share memory whitout really creating a phisical file, because i rather not do that. So can u use the Api-createfilemapping, whitout really creating a file which is visible on the hard drive?

Regards,
PyroMathic
Posted on 2005-04-08 16:14:14 by pyr0_mathic

i looked the thing about the shared section in the dll's up, but that also uses the CreateFileMapping api, for as far as i can see.

Nope - you create a section, and call it ".shared" or ".hatter" or whatever you want. At link-time, you add /SECTION:.shared,RWS to the linker commandline.


But is there then a way to share memory whitout really creating a phisical file

CreateFileMapping with the hFile parameter being INVALID_HANDLE_VALUE - that way the paging file is used as backing.

Posted on 2005-04-09 02:58:52 by f0dder