Re: Passing ids to Distributed Objects
Re: Passing ids to Distributed Objects
- Subject: Re: Passing ids to Distributed Objects
- From: Nicolai <email@hidden>
- Date: Fri, 6 Dec 2002 22:53:18 +0100
Thanks for everyone who did help me!
I finally figured out the problem and passed an int instead of the
id. Regarding to the note of Chris who is one of the holy Cocoa framework
developers I will replace it by a uintptr_t instantly! :)
Greets, Nico.
On Donnerstag, Dezember 5, 2002, at 08:39 Uhr, Chris Kane wrote:
The PictureData object is probably not surviving the archiving and
unarchiving that DO will do (even between threads in the same task),
for any number of reasons.
What you are trying to do here is pass a pointer -- as a value --
between two threads, rather than the data/object pointed to. There is
this ambiguity of meaning, in C, and DO chooses to always interpret
pointers as being pointers to the data/objects which need to be shipped
to the other end of the connection. DO could have chosen to treat
(void *) pointers as flat values and used that as the escape hatch to
send pointer values, but it was implemented long ago to simply disallow
void * pointers, and that hasn't changed. (Probably is easier for
people to figure out what is going wrong to disallow that, rather than
send a flat pointer value for a void *.)
Instead, to disguise the pointers from DO, you need to use the
uintptr_t type as the parameter type (stdint.h is already included for
you) and cast.
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.