Placement into shared memory?
Marc D Ronell
mronell@alumni.upenn.edu
Sun Apr 24 05:15:00 GMT 2005
>>>>> "Arturas" == Arturas Moskvinas <arturas.moskvinas@gmail.com> writes:
>> What is the current correct approach to instantiating objects
>> in shared memory so that multiple processes can access the C++
>> objects?
Arturas> Why exactly do you want to do this? Maybe it is much
Arturas> easier to share data not objects. Simply then you must
Arturas> create an object in each process and for data processing
Arturas> use shared memory data (of course some locking will be
Arturas> needed if data will be changed).
Arturas> Or try using threads, if i'm not wrong, they exist in the
Arturas> same memory and they will see your object correctly.
For this application, threads do not make good sense. One process is
compute bound and the other is I/O bound. Separate processes are
strongly preferable.
Thanks for the reply and thoughts,
Marc
--
Marc Ronell, PhD CSE, PE EE
More information about the Gcc-help
mailing list