Re: Shared Memory and Distributed Objects
Re: Shared Memory and Distributed Objects
- Subject: Re: Shared Memory and Distributed Objects
- From: Dan Bernstein <cocoa-dev%email@hidden>
- Date: Sun, 16 Feb 2003 19:18:30 +0200
On Sunday, February 16, 2003, at 06:56 PM, publiclook wrote:
IIt is likely that problems 1 and 2 can be overcome.
What I want to know is how :-)
I did a quick check of the man pages and there are no ipcs or ipcrm
commands. That makes me worry a little about how good Darwin's
emulation of Sys V shared memory is.
This is what got me worried that maybe the problems can't be overcome...
It is also likely that DO will work for you. When an object such as an
NSData instance is passed between processes via DO, the normal
behavior is that one process has the actual instance and the other has
only a proxy. If you pass an NSData instance this way, the storage of
the NSData instance is not copied.
Indeed.
When the process that has the proxy asks for the NSData instance's
contents with a message, the message is delivered to the actual object
in another process and the data (probably a subset of all of the data)
is transmitted over the connection only then.
Yeah, well, the message is -[bytes], and it returns a void * in the
client's address space. From what I've seen, while without byCopy no
immediate copying of the memory occurs, it doesn't just map the same
data into the client's space - it also prevents any future changes the
server makes to the memory to appear in the client's space, via the
technique I've described in the original message. Not exactly what I
want.
If you need very fast random access to 1M of memory shared by two or
more processes,
I do.
I think shared memory is the way to go. I have some experience with
shared memory for other Unix like platforms. I think Darwin provides
an emulation layer for Sys V style shared memory, but I haven't tried
it. There are certainly other applications on the system using similar
features. Make sure that Darwin's limit for shared memory sizes is not
too small.
Does anybody know what they are?
Thanks,
-- Dan Bernstein
_______________________________________________
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.