This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Placement into shared memory?


>>>>> "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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]