• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: DO Proxy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DO Proxy


  • Subject: Re: DO Proxy
  • From: Charles Srstka <email@hidden>
  • Date: Tue, 14 May 2002 00:08:41 -0500

On Monday, May 13, 2002, at 11:10 PM, Ovidiu Predescu wrote:

On Mon, 13 May 2002 21:25:05 -0500, Timothy Ritchey <email@hidden> wrote:

Okay, here is what my experimentation seems to have found:

1) given two applications/threads/tasks, etc. A and B that have been
connected with NSConnection, if you pass an object, say X, from A to B,
and then back from B to A, the run-time is smart enough to give you back
the original object, and not a proxy.

2) Add a third app C. If C connects to B and asks for X, it will
establish its own connection to A. B can disappear, and C's proxy to X
will keep on trucking.

3) However, if you pass X from C back to A, A gets a proxy to X, and not
the original object back as in (1). The level of indirection that occurs
in (2) does not appear to be handled optimally by the run-time system.

I wonder how this is possible, since C has a proxy to X in A. If you
pass the proxy to X from C back into A, A should get its own object,
and not a proxy. Is this last proxy a proxy to C's proxy to A, if you
understand what I mean ;)? Something doesn't sound right to me if
this is the case, as it contradicts the way the so-called "triangle
connection" works in DO.

I remember in the system I implemented long ago it was impossible to
invoke a message on a proxy to a proxy to an object using the NeXT
runtime. This was because in the NeXT runtime the Objective-C selector
has no method signature information associated with it, so it is
impossible to de-construct the method call without having the real
class of the receiver available. But since in the case of a proxy to a
proxy the receiver's class is the Proxy class, it is impossible to
obtain this information.

The GNU Objective-C runtime helps in such a case since the selector
has the method signature information associated with it. Nevertheless,
the correct solution is to short-circuit the triangle connection by
creating a direct connection.

I once tried having a DO connection between several worker threads and a main thread, and the main thread had a DO connection to another process. The worker threads would send a message to the main thread's proxy, which would send a message to the other process's proxy. The method got called, but it never returned - the app would hang here forever unless the method was oneway void. There didn't seem to be any way to get it to work, so I scrapped that model, and just had the other process register its connection...
_______________________________________________
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.
  • Follow-Ups:
    • Re: DO Proxy
      • From: Ovidiu Predescu <email@hidden>
References: 
 >Re: DO Proxy (From: Ovidiu Predescu <email@hidden>)

  • Prev by Date: Re: referring to global windows
  • Next by Date: Displaying top
  • Previous by thread: Re: DO Proxy
  • Next by thread: Re: DO Proxy
  • Index(es):
    • Date
    • Thread