DO - Multiple thread access to root proxy needs protocol set?
DO - Multiple thread access to root proxy needs protocol set?
- Subject: DO - Multiple thread access to root proxy needs protocol set?
- From: Simon Liu <email@hidden>
- Date: Fri, 17 Sep 2004 17:44:17 +0100
Hi,
I can get object A in Thread A, and object B in Thread B talking to
each other successfully via DO (NSConnection rootProxy).
However if I introduce a Thread C on object B, I cannot get Thread C
to use the rootProxy to message object A in Thread A. The error is
that Thread C will hang. I have set the protocol declaration for the
method to (oneway void) so it should be an asynchronous call. I have
also enabled multiple threads on the NSConnection.
The solutions I have found to this are:
(1) Set the protocol for the rootProxy which Thread C is going to use
(easy solution)
(2) Alternatively, if you don't set the protocol for the rootProxy,
ensure that Thread B invokes the method at least once, before any
attempt by Thread C.
While normally, you don't need to set the protocol for rootproxies, It
seems that for multiple threads it is a necessity, although I haven't
come across any such mention in the docs. Or perhaps its a bug?
Any insight appreciated. Thanks.
Regards,
Simon Liu
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden