C++/Shared Memory
Expert: Zlatko - 5/24/2010
QuestionHI,
I would like to learn about shared memory implementaion. I have basic idea about that. But, still i need some more example how shared memory implemented in mission critical applications. Kindly send me some reference URL or post some explainations
AnswerHello Lakshmipathy
Shared memory is used for communication between processes. I have seen it used in simulations, where multiple processes worked on shared data to run a simulation. A "blackboard architecture" would use shared memory. See
http://en.wikipedia.org/wiki/Blackboard_system
For me, shared memory is used less often than other inter-process communication methods.
How to create shared memory depends on which operating system you are using.
For Microsoft Windows, you need to use memory mapped files. You can read about that at
http://msdn.microsoft.com/en-us/library/ms810613.aspx
For unix/linux, you can read this:
http://beej.us/guide/bgipc/output/html/multipage/shm.html
If you have difficulties understanding the links, ask me a specific question. Be sure to tell me what operating system you are using.
Best regards
Zlatko