[omniORB] Main Thread Mode - POA Questions
Craig Wright
craig.wright at cometsolutions.com
Thu Nov 13 09:10:20 GMT 2003
On Thursday 13 November 2003 07:03, scott.rediger at teradyne.com wrote:
> Craig,
>
> I had the same issue with needing a non-reentrant CORBA server. You just
> need to create a new POA as a child of the root POA (under the same
> POAManager), whith a policy of PortableServer::SINGLE_THREAD_MODEL. If
> you don't have it, you should get the "Advanced CORBA Programming with
> C++" book by Henning and Vinoski - it goes through all of this in
> detail. Below is what I would have had to add to your code to make our
>
Thank you. This is what I was looking for, however the line:
root_poa->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL)
should have (for my case) been:
root_poa->create_thread_policy(PortableServer::MAIN_THREAD_MODEL)
I actually do own a copy of Henning and Vinoski. I guess I should read more of
its 1000 pages in more depth. :)
Anyway, thanks again.
-Craig Wright.
> app work:
> >orb_ = CORBA::ORB_init(argc, argv, "omniORB4");
> >CORBA::Object_var obj = orb_->resolve_initial_references("RootPOA");
> >poa_ = PortableServer::POA::_narrow(obj);
> >PortableServer::POAManager_var pman = poa_->the_POAManager();
>
> CORBA::PolicyList pl;
> pl.length(1);
> pl[0] =
> root_poa->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL);
>
> PortableServer::POA_var my_poa = root_poa->create_POA("myPOA", pman,
> pl);
>
> // activate our object in the new POA
> MyObject_var my_obj = new MyObjectServant();
> PortableServer::ObjectID_var myObjID = my_poa->activate_object(my_obj)
>
> >pman->activate();
>
> Hope this helps,
> Scott Rediger
>
>
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
--
More information about the omniORB-list
mailing list