[Ace-users] Re: Singlethread servant upcall (using CSD)
johnc at ociweb
cjujohn at gmail.com
Mon Oct 1 10:13:48 CDT 2007
Hi Jochen,
My response below:
On Oct 1, 1:58 am, Jochen Rothenbacher <jochen.rothenbac... at nsn.com>
wrote:
> ACE VERSION: 5.5.6
>
> HOST MACHINE and OPERATING SYSTEM:
> sun solaris 10
>
> TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> COMPILER NAME AND VERSION (AND PATCHLEVEL):
>
> CC: Sun C++ 5.7 Patch 117830-08 2006/07/12
>
> THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
> specific file, simply state which one]:
>
> #include "ace/config-sunos5.10.h"
>
> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
> use a link to a platform-specific file, simply state which one
> (unless this isn't used in this case, e.g., with Microsoft Visual
> C++)]:
>
> include $(ACE_ROOT)/include/makeinclude/platform_sunos5_sunc++.GNU
>
> CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
> (used by MPC when you generate your own makefiles):
> ssl=0
> qos=0
>
> DOES THE PROBLEM AFFECT:
> EXECUTION:
> Singlethread servant upcall not working?
>
> SYNOPSIS:
> Although policy set to SINGLE_THREAD_MODEL calls are dispated in
> two threads.
>
> DESCRIPTION:
>
> We have a multithreaded process framework using the CSD.
>
> The process consists of a main thread with the mainloop which
> triggers several event input queues to dispatch events. The input
> queues have seperate (worker-)threads for feeding the queues with
> events.
>
> One of these input queues is feeded with CORBA calls using the
> CSD. In this thread we run the CORBA::ORB::run() to handle events.
>
> Each server is using a child POA which is configured with these
> policies
>
> // Create the child POA.
> CORBA::PolicyList policies;
> policies.length(2);
> policies[0] =
> mRootPoa->create_implicit_activation_policy
> (PortableServer::IMPLICIT_ACTIVATION);
> policies[1] = mRootPoa->create_thread_policy
> (PortableServer::SINGLE_THREAD_MODEL);
>
> The CSD is used as follows. We've overloaded
> dispatch_remote_request_i()
>
> TAO::CSD::Strategy_Base::DispatchResult
> SYS::Strategy::dispatch_remote_request_i
> (TAO_ServerRequest& server_request,
> const PortableServer::ObjectId& object_id,
> PortableServer::POA_ptr poa,
> const char* operation,
> PortableServer::Servant servant)
> {
>
> // create the CorbaRequest object, and then add it to
> // our "request queue".
>
> if (mInputManager) {
> CorbaRequest* request = new CorbaRequest(server_request,
> object_id, poa,
> operation, servant);
> (void)mInputManager->enqueue(request);
> }
> }
>
> Further we configured "direct collocation" with the IDL Compiler
> flags "Sp -Gd".
>
> What we observed was that there were incoming calls using our
> Strategy appearing in the thread where we call CORBA::ORB::run()
> to handle events, but also a few in the main thread where
> we call our mainloop.
>
> Shouldn't the policy PortableServer::SINGLE_THREAD_MODEL guarantee
> that there are no concurrent servant upcalls?
SINGLE_THREAD_MODEL policy is a POA policy. Using direct collocation
you are bypassing the POA and therefore the single threaded strategy
doesn't come into play. I recommend using the 'thru_poa' collocation
strategy. Let us know if you run into any further issues.
Please contact sales at ociweb.com for support.
regards,
Ciju
>
> Gruss Jochen
>
> --
> ----------------------------------------------------------
> Jochen Rothenbacher
More information about the Ace-users
mailing list