Re: Shared Memory and Distributed Objects
Re: Shared Memory and Distributed Objects
- Subject: Re: Shared Memory and Distributed Objects
- From: Chris Kane <email@hidden>
- Date: Sun, 16 Feb 2003 15:07:41 -0800
On Sunday, February 16, 2003, at 03:37 AM, Dan Bernstein wrote:
I'm taking my first steps with distributed objects, and I'm looking
for an *efficient* way to make a large (~1MB) area of one process's
memory available to a second process for reading. Here's what I've
tried so far:
1. Using a shared memory object, opened with shm_open() and mapped
with mmap().
[...]
Is there a way to do what I want using DOs? If not, can the problems
in 1. or 2. above be overcome?
I think you are conflating two separate things here. If you were using
Distributed Objects (which normally means Cocoa Distributed Objects
when capitalized), you wouldn't do anything with shared memory. If you
want to do shared memory, that would not directly relate to Distributed
Objects. Though both can be used in the same program(s), you would not
use them together or integrate them.
Particularly, it is not safe to put ObjC objects in shared memory, and
use them from two or more different processes. The first and least
problem is that ObjC objects contain an isa pointer (and only one) to
their class object, and the class object's address is not necessarily
the same in all processes. An object would have to have potentially
many isa pointers, for the different processes.
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.