Re: Bonobo::Unknown - ref counting over CORBA



Hi David,

On Fri, 2002-01-25 at 20:08, David Hanney wrote:
> Q1:
> What happens when my code does Bonobo::ref()
> followed by Bonobo::unref() on a remote object.
> Does this result in two round-trips over the wire
> for a net-effect of nothing?

	Yes - two round trips over the wire. This is necessary since we have
(by faulty initial design) no way to determine when a CORBA reference is
passed and when a Bonobo reference is passed by a method - thus we
cannot cache this locally - which is somewhat tragic.

	So - if you think you need to do lots of referencing, create a local
wrapper that does what you need.

> Q2:
> What happens when my kernel crashes
> and so my code never gets to Bonobo::unref() a remote
> Bonobo object - does that remote object leak?

	Yes - it leaks; however you can obviate that by connecting to the
"broken" signal on the connection, see
ORBit2/include/orbit/orb-core/orbit-small.h.

	Then when the TCP timeout ( or almost instant UDS broken notification )
happens, you will get a callback and can cleanup the object in whatever
way you see fit.

	If you're exporting a service it's prolly best to have a single Bonobo
ref count, and set the immortal flag on the bonobo-object(.h) so that
you control the life cycle more sensibly.

	HTH,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]