Re: graceful mulit-threaded shutdown



Hi,

On Tue, 11 Nov 2003 20:59:43 +0100, Tyler Kohn wrote:
...
> >> In my "run" method, after g_main_loop_run (loop) returns I call:
> >>     CORBA_Object_release(servant, ev);
> >
> >	Servants are normally user-instantiated objects, and not CORBA_Objects
> >- is the above correct ?
> 
> The servant is instantiated via (eventually) by:
> 	PortableServer_POA_servant_to_reference(poa, newservant, ev); 
> in skelimpl.  Is it invalid to "release" the servant in this way?  I was
> trying to follow the examples for shutting down.

ref/unref:
  ORBit_RootObject_duplicate() does
  	robj->refs++;
  while CORBA_Object_release()->ORBit_RootObject_release()->do_unref() does
  	robj->refs--;


Cases of CORBA_Object_release() in my code:

* CORBA_Object_release(Vfs_object,&captive_corba_ev);
  corresponds to:
  	Vfs_object=impl_Captive_Vfs__create(captive_corba_poa,&captive_corba_ev);
  where impl_Captive_Vfs__create() skeleton was generated with trailing
  	retval=PortableServer_POA_servant_to_reference(poa,newservant,ev);
  and PortableServer_POA_servant_to_reference() codepaths finish by
  either ORBit_RootObject_duplicate() or ORBit_POA_obj_to_ref()
  and ORBit_POA_obj_to_ref() leads to ORBit_RootObject_duplicate() again
  	return ORBit_RootObject_duplicate (pobj->base.objref);

  Also ORBit2/test/echo-srv.c/echo_srv_finish_object() does
  	CORBA_Object_release(the_echo_client, ev);

* CORBA_Object_release((CORBA_Object)poa_mgr,evp);
  corresponds to:
  	poa_mgr=PortableServer_POA__get_the_POAManager(*poap,evp);
  as PortableServer_POA__get_the_POAManager() is implemented as
  	return ORBit_RootObject_duplicate (poa->poa_manager);

* CORBA_Object_release((CORBA_Object)poa,evp);
  corresponds to:
  	*poap=(PortableServer_POA)CORBA_ORB_resolve_initial_references(*orbp,"RootPOA",evp);
  where CORBA_ORB_resolve_initial_references() leads to
  	return ORBit_RootObject_duplicate (objref);



Regards,
Lace

-- 
Jan Kratochvil; Captive: free r/w NTFS Filesystem; http://www.jankratochvil.net/



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