On 2007-09-13 12:30, Oops-c++ wrote:
All,
I came to know that, we can define #pragma variables to share values
between the processes.
#pragma data_seg(".shared")
var1
variable2
#pragma data_seg()
Is there are any advantages/disadv. over using file mapping. Can any
one send me detials or any link which compares or explains about these
shared variables
A problem with all progma directives is that most or perhaps all of them
are implementation dependent. That means that compiling the same code
with another compiler or even just with another version of the same
compiler might give different results. IIRC a compiler should just
ignore any pragmas that it does not understand.
There are an number of different ways to share data between processes,
which one you should use depends on a lot of things, like which platform
your program runs on, how much data you need to share, and in which
manner you need to share it. For better advice explain your needs in a
group discussing your platform. The FAQ have some suggestions of groups:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
--
Erik Wikström