summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2003-08-26 21:30:42 +0000
committerbala <balanatarajan@users.noreply.github.com>2003-08-26 21:30:42 +0000
commitccab51fecbcf72d2561ace65235c8710c84a7281 (patch)
treecdca04a21a8494f3f5cae6cad63b0988fc21616c
parent1babeb148d277d762f324d525a835fc331a72e79 (diff)
downloadATCD-ccab51fecbcf72d2561ace65235c8710c84a7281.tar.gz
ChangeLogTag:Tue Aug 26 16:42:05 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r--TAO/ChangeLog_ref68
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp2
-rw-r--r--TAO/tao/Asynch_Reply_Dispatcher_Base.cpp6
-rw-r--r--TAO/tao/Asynch_Reply_Dispatcher_Base.i9
-rw-r--r--TAO/tao/Exclusive_TMS.cpp13
-rw-r--r--TAO/tao/Exclusive_TMS.h4
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp2
-rw-r--r--TAO/tao/IIOP_Transport.cpp2
-rw-r--r--TAO/tao/Messaging/Asynch_Invocation.cpp24
-rw-r--r--TAO/tao/Muxed_TMS.cpp14
-rw-r--r--TAO/tao/Muxed_TMS.h4
-rw-r--r--TAO/tao/ORB_Core.cpp35
-rw-r--r--TAO/tao/ORB_Core.h10
-rw-r--r--TAO/tao/Profile_Transport_Resolver.cpp5
-rw-r--r--TAO/tao/Profile_Transport_Resolver.h7
-rw-r--r--TAO/tao/Profile_Transport_Resolver.inl6
-rw-r--r--TAO/tao/Remote_Invocation.cpp1
-rw-r--r--TAO/tao/Strategies/SCIOP_Transport.cpp4
-rw-r--r--TAO/tao/Strategies/SHMIOP_Transport.cpp2
-rw-r--r--TAO/tao/Strategies/UIOP_Transport.cpp3
-rw-r--r--TAO/tao/Synch_Invocation.cpp28
-rw-r--r--TAO/tao/Thread_Lane_Resources.cpp60
-rw-r--r--TAO/tao/Thread_Lane_Resources.h23
-rw-r--r--TAO/tao/Transport.cpp6
-rw-r--r--TAO/tao/Transport_Cache_Manager.cpp4
-rw-r--r--TAO/tao/Transport_Mux_Strategy.h10
-rw-r--r--TAO/tao/default_resource.cpp17
-rw-r--r--TAO/tao/orbconf.h4
28 files changed, 298 insertions, 75 deletions
diff --git a/TAO/ChangeLog_ref b/TAO/ChangeLog_ref
index 6dd52cf7e28..a330989c7a3 100644
--- a/TAO/ChangeLog_ref
+++ b/TAO/ChangeLog_ref
@@ -1,3 +1,71 @@
+Tue Aug 26 16:42:05 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
+
+ * tao/Asynch_Reply_Dispatcher_Base.cpp: Removed the call to
+ idle_after_reply () since it is taken care by the transport
+ resolver.
+
+ * tao/Asynch_Reply_Dispatcher_Base.i: Cosmetic fix
+
+ * tao/Exclusive_TMS.cpp:
+ * tao/Exclusive_TMS.h:
+ * tao/Muxed_TMS.cpp:
+ * tao/Muxed_TMS.h:
+ * tao/Transport_Mux_Strategy.h: Changed the signature of
+ idle_after_send () and idle_after_reply () to return a
+ bool instead of an int.
+
+ * tao/ORB_Core.cpp:
+ * tao/ORB_Core.h: Remove the output CDR allocators from the
+ TSS. They now go into the lanes. This is needed since the CDR's
+ are now housed within the transport.
+
+ * tao/Thread_Lane_Resources.cpp:
+ * tao/Thread_Lane_Resources.h: The output CDR's are now here
+ instead of the TSS.
+
+ * tao/GIOP_Message_Base.cpp: Cosmetic fix.
+
+ * tao/Profile_Transport_Resolver.cpp:
+ * tao/Profile_Transport_Resolver.h:
+ * tao/Profile_Transport_Resolver.inl: Added a new method
+ transport_released () method that sets a flag is_released_ to
+ true. The flag is used to indicate whether the transport has
+ been released to the transport cache or not.
+
+ * tao/IIOP_Transport.cpp:
+ * tao/Strategies/SCIOP_Transport.cpp:
+ * tao/Strategies/SHMIOP_Transport.cpp:
+ * tao/Strategies/UIOP_Transport.cpp: The method send_message ()
+ does not call idle_after_send () anymore. This is taken care
+ elsewhere.
+
+ * tao/Remote_Invocation.cpp: Cosmetic fix.
+
+ * tao/Synch_Invocation.cpp:
+ * tao/Messaging/Asynch_Invocation.cpp: Call idle_after_send () and
+ idle_after_reply () on the transport after sending and receiving
+ the replies. This is used to release the transport in case
+ errors occur.
+
+ * tao/Transport.cpp: Added a debug statement
+
+ * tao/Transport_Cache_Manager.cpp: Cosmetic fix.
+
+ * tao/default_resource.cpp: The output cdr now uses global locked
+ allocater instead of the non-locked ones that were used. Removed
+ the typedef's of the lock free allocators.
+
+ * tao/orbconf.h: Added a #if defined for local memory pools. This
+ is in reference to this change "Fri Jul 18 17:26:32 2003 Chris
+ Cleeland <cleeland_c@ociweb.com>". The above change always set
+ the allocator to use the the ACE_New_Allocator.
+
+ With the addition to orbconf.h file, the user can choose to use
+ the type of allocator at compile time. The option now defaults
+ to use the local memory pool. It would be better to use a
+ runtime option instead of this compile time option. Will get to
+ that later.
+
Tue Aug 26 10:05:06 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
* TAO_IDL/be/be_codegen.cpp: Included the new header for AMI
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
index 4b6d332beee..c3cc3b542f6 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
@@ -146,7 +146,7 @@ TAO_SSLIOP_Transport::send_request (TAO_Stub *stub,
return -1;
- return this->idle_after_send ();
+ return 0;
}
int
diff --git a/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp b/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp
index 47b6934cf0c..d0064880652 100644
--- a/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp
+++ b/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp
@@ -36,11 +36,9 @@ TAO_Asynch_Reply_Dispatcher_Base::TAO_Asynch_Reply_Dispatcher_Base (TAO_ORB_Core
// Destructor.
TAO_Asynch_Reply_Dispatcher_Base::~TAO_Asynch_Reply_Dispatcher_Base (void)
{
+ // Release the transport that we own
if (this->transport_ != 0)
- {
- this->transport_->idle_after_reply ();
- this->transport_->remove_reference ();
- }
+ this->transport_->remove_reference ();
}
// Must override pure virtual method in TAO_Reply_Dispatcher.
diff --git a/TAO/tao/Asynch_Reply_Dispatcher_Base.i b/TAO/tao/Asynch_Reply_Dispatcher_Base.i
index 232f938f7ff..aadeeebfe29 100644
--- a/TAO/tao/Asynch_Reply_Dispatcher_Base.i
+++ b/TAO/tao/Asynch_Reply_Dispatcher_Base.i
@@ -3,12 +3,11 @@
ACE_INLINE void
TAO_Asynch_Reply_Dispatcher_Base::transport (TAO_Transport *t)
{
- if (this->transport_ != 0) {
- this->transport_->remove_reference ();
- }
+ if (this->transport_ != 0)
+ {
+ this->transport_->remove_reference ();
+ }
this->transport_ = t;
this->transport_->add_reference ();
}
-
-
diff --git a/TAO/tao/Exclusive_TMS.cpp b/TAO/tao/Exclusive_TMS.cpp
index 8b643c07db7..4c55ce39ca8 100644
--- a/TAO/tao/Exclusive_TMS.cpp
+++ b/TAO/tao/Exclusive_TMS.cpp
@@ -100,19 +100,22 @@ TAO_Exclusive_TMS::dispatch_reply (TAO_Pluggable_Reply_Params &params)
return rd->dispatch_reply (params);
}
-int
+bool
TAO_Exclusive_TMS::idle_after_send (void)
{
- return 0;
+ return false;
}
-int
+bool
TAO_Exclusive_TMS::idle_after_reply (void)
{
+ // Irrespective of whether we are successful or not we need to
+ // return true. If *this* class is not successfull in idling the
+ // transport no one can.
if (this->transport_ != 0)
- return this->transport_->make_idle ();
+ (void) this->transport_->make_idle ();
- return 0;
+ return true;
}
void
diff --git a/TAO/tao/Exclusive_TMS.h b/TAO/tao/Exclusive_TMS.h
index 55b1308c53b..1d00625373a 100644
--- a/TAO/tao/Exclusive_TMS.h
+++ b/TAO/tao/Exclusive_TMS.h
@@ -58,8 +58,8 @@ public:
virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params);
- virtual int idle_after_send (void);
- virtual int idle_after_reply (void);
+ virtual bool idle_after_send (void);
+ virtual bool idle_after_reply (void);
virtual void connection_closed (void);
//@}
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index cbea04151b8..4de42df0a07 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -24,7 +24,7 @@ TAO_GIOP_Message_Base::TAO_GIOP_Message_Base (TAO_ORB_Core *orb_core,
size_t /*input_cdr_size*/)
: orb_core_ (orb_core)
, message_state_ (orb_core,
- this)
+ this)
, out_stream_ (this->buffer_,
sizeof this->buffer_, /* ACE_CDR::DEFAULT_BUFSIZE */
TAO_ENCAP_BYTE_ORDER,
diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp
index 2dd72aebaf6..4c3a22a2c5d 100644
--- a/TAO/tao/IIOP_Transport.cpp
+++ b/TAO/tao/IIOP_Transport.cpp
@@ -180,7 +180,7 @@ TAO_IIOP_Transport::send_request (TAO_Stub *stub,
this->first_request_sent();
- return this->idle_after_send ();
+ return 0;
}
int
diff --git a/TAO/tao/Messaging/Asynch_Invocation.cpp b/TAO/tao/Messaging/Asynch_Invocation.cpp
index 72bb571a0ac..790d7de27d6 100644
--- a/TAO/tao/Messaging/Asynch_Invocation.cpp
+++ b/TAO/tao/Messaging/Asynch_Invocation.cpp
@@ -96,9 +96,27 @@ namespace TAO
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+#if TAO_HAS_INTERCEPTORS == 1
+ // If the above call returns a restart due to connection
+ // failure then call the receive_other interception point
+ // before we leave.
+ if (s == TAO_INVOKE_RESTART)
+ {
+ s =
+ this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+#endif /*TAO_HAS_INTERCEPTORS */
+
if (s != TAO_INVOKE_SUCCESS)
return s;
+ // For some strategies one may want to release the transport
+ // back to cache. If the idling is successfull let the
+ // resolver about that.
+ if (this->resolver_.transport ()->idle_after_send ())
+ this->resolver_.transport_released ();
+
// @@ In all MT environments, there's a cancellation point lurking
// here; need to investigate. Client threads would frequently be
// canceled sometime during recv_request ... the correct action to
@@ -115,7 +133,11 @@ namespace TAO
// according to POSIX, all C stack frames must also have their
// (explicitly coded) handlers called. We assume a POSIX.1c/C/C++
// environment.
-
+#if TAO_HAS_INTERCEPTORS == 1
+ s =
+ this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#endif /*TAO_HAS_INTERCEPTORS */
}
ACE_CATCHANY
{
diff --git a/TAO/tao/Muxed_TMS.cpp b/TAO/tao/Muxed_TMS.cpp
index bc830ea847e..1feecf2e6ab 100644
--- a/TAO/tao/Muxed_TMS.cpp
+++ b/TAO/tao/Muxed_TMS.cpp
@@ -173,20 +173,22 @@ TAO_Muxed_TMS::dispatch_reply (TAO_Pluggable_Reply_Params &params)
return result;
}
-int
+bool
TAO_Muxed_TMS::idle_after_send (void)
{
+ // Irrespective of whether we are successful or not we need to
+ // return true. If *this* class is not successfull in idling the
+ // transport no one can.
if (this->transport_ != 0)
- return this->transport_->make_idle ();
+ (void) this->transport_->make_idle ();
- return 0;
+ return true;
}
-int
+bool
TAO_Muxed_TMS::idle_after_reply (void)
{
- // No op.
- return 0;
+ return false;
}
void
diff --git a/TAO/tao/Muxed_TMS.h b/TAO/tao/Muxed_TMS.h
index 82c7843376a..c204f85e64b 100644
--- a/TAO/tao/Muxed_TMS.h
+++ b/TAO/tao/Muxed_TMS.h
@@ -59,8 +59,8 @@ public:
virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params);
- virtual int idle_after_send (void);
- virtual int idle_after_reply (void);
+ virtual bool idle_after_send (void);
+ virtual bool idle_after_reply (void);
virtual void connection_closed (void);
protected:
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 5c4e89cbe07..17524d3b963 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -2313,6 +2313,9 @@ ACE_Allocator*
TAO_ORB_Core::output_cdr_dblock_allocator (void)
{
+ return this->lane_resources ().output_cdr_dblock_allocator ();
+
+#if 0
// Allocating memory here confuses purify a bit. We do delete this
// memory when TSS delete
TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
@@ -2328,11 +2331,15 @@ TAO_ORB_Core::output_cdr_dblock_allocator (void)
this->resource_factory ()->output_cdr_dblock_allocator ();
return tss->output_cdr_dblock_allocator_;
+#endif /* if 0*/
}
ACE_Allocator*
TAO_ORB_Core::output_cdr_buffer_allocator (void)
{
+ return this->lane_resources ().output_cdr_buffer_allocator ();
+
+#if 0
TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
if (tss == 0)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -2346,12 +2353,15 @@ TAO_ORB_Core::output_cdr_buffer_allocator (void)
this->resource_factory ()->output_cdr_buffer_allocator ();
return tss->output_cdr_buffer_allocator_;
+#endif /*if 0*/
}
ACE_Allocator*
TAO_ORB_Core::output_cdr_msgblock_allocator (void)
{
+ return this->lane_resources ().output_cdr_msgblock_allocator ();
+#if 0
TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
if (tss == 0)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -2365,6 +2375,7 @@ TAO_ORB_Core::output_cdr_msgblock_allocator (void)
this->resource_factory ()->output_cdr_msgblock_allocator ();
return tss->output_cdr_msgblock_allocator_;
+#endif /*if 0*/
}
@@ -2833,14 +2844,11 @@ TAO_ORB_Core::ior_interceptor_adapter (void)
// ****************************************************************
TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void)
- : output_cdr_dblock_allocator_ (0),
- output_cdr_buffer_allocator_ (0),
- output_cdr_msgblock_allocator_ (0),
- event_loop_thread_ (0),
- client_leader_thread_ (0),
- lane_ (0),
- ts_objects_ (),
- orb_core_ (0)
+ : event_loop_thread_ (0)
+ , client_leader_thread_ (0)
+ , lane_ (0)
+ , ts_objects_ ()
+ , orb_core_ (0)
#if TAO_HAS_INTERCEPTORS == 1
, pi_current_ ()
, client_request_info_ (0)
@@ -2854,17 +2862,6 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void)
TAO_ORB_Core_TSS_Resources::~TAO_ORB_Core_TSS_Resources (void)
{
- if (this->output_cdr_dblock_allocator_ != 0)
- this->output_cdr_dblock_allocator_->remove ();
- delete this->output_cdr_dblock_allocator_;
-
- if (this->output_cdr_buffer_allocator_ != 0)
- this->output_cdr_buffer_allocator_->remove ();
- delete this->output_cdr_buffer_allocator_;
-
- if (this->output_cdr_msgblock_allocator_ != 0)
- this->output_cdr_msgblock_allocator_->remove ();
- delete this->output_cdr_msgblock_allocator_;
#if TAO_HAS_INTERCEPTORS == 1
CORBA::release (this->client_request_info_);
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index b0a4f95613a..f84482c34b8 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -132,14 +132,6 @@ private:
public:
-
- /// The allocators for the output CDR streams.
- //@{
- ACE_Allocator *output_cdr_dblock_allocator_;
- ACE_Allocator *output_cdr_buffer_allocator_;
- ACE_Allocator *output_cdr_msgblock_allocator_;
- //@}
-
/**
* @todo
* The rest of the resources are not currently in use, just a plan
@@ -176,9 +168,7 @@ public:
};
-
// ****************************************************************
-
/**
* @class TAO_ORB_Core
*
diff --git a/TAO/tao/Profile_Transport_Resolver.cpp b/TAO/tao/Profile_Transport_Resolver.cpp
index 107732b9c6e..1eef8a653e3 100644
--- a/TAO/tao/Profile_Transport_Resolver.cpp
+++ b/TAO/tao/Profile_Transport_Resolver.cpp
@@ -28,6 +28,7 @@ namespace TAO
, stub_ (stub)
, transport_ (0)
, profile_ (0)
+ , is_released_ (false)
{
}
@@ -38,8 +39,10 @@ namespace TAO
if (this->transport_)
{
- this->transport_->make_idle ();
this->transport_->remove_reference ();
+
+ if (this->is_released_ == false)
+ this->transport_->make_idle ();
}
}
diff --git a/TAO/tao/Profile_Transport_Resolver.h b/TAO/tao/Profile_Transport_Resolver.h
index 25e03f3a736..7e1fde2c694 100644
--- a/TAO/tao/Profile_Transport_Resolver.h
+++ b/TAO/tao/Profile_Transport_Resolver.h
@@ -93,6 +93,10 @@ namespace TAO
TAO_Transport *transport (void) const;
//@}
+ /// Signal to let the resolver know that the transport has been
+ /// released back to the cache.
+ void transport_released (void) const;
+
/// This is a callback method used by the endpoint selectors, to
/// delegate the responsibility of reserving a transport from the
/// connection cache for this invocation.
@@ -119,6 +123,9 @@ namespace TAO
/// The profile that has been selected for this invocation.
TAO_Profile *profile_;
+
+ /// Has the transport been idled?
+ mutable bool is_released_;
};
} // TAO namespace end
diff --git a/TAO/tao/Profile_Transport_Resolver.inl b/TAO/tao/Profile_Transport_Resolver.inl
index b984e726f67..8d653e1adce 100644
--- a/TAO/tao/Profile_Transport_Resolver.inl
+++ b/TAO/tao/Profile_Transport_Resolver.inl
@@ -25,4 +25,10 @@ namespace TAO
{
return this->transport_;
}
+
+ ACE_INLINE void
+ Profile_Transport_Resolver::transport_released (void) const
+ {
+ this->is_released_ = true;
+ }
}
diff --git a/TAO/tao/Remote_Invocation.cpp b/TAO/tao/Remote_Invocation.cpp
index b5d1e041aba..2fdb2e46130 100644
--- a/TAO/tao/Remote_Invocation.cpp
+++ b/TAO/tao/Remote_Invocation.cpp
@@ -151,6 +151,7 @@ namespace TAO
}
this->resolver_.stub ()->set_valid_profile ();
+
return TAO_INVOKE_SUCCESS;
}
}
diff --git a/TAO/tao/Strategies/SCIOP_Transport.cpp b/TAO/tao/Strategies/SCIOP_Transport.cpp
index 0c8f72b5b41..d29f71344f9 100644
--- a/TAO/tao/Strategies/SCIOP_Transport.cpp
+++ b/TAO/tao/Strategies/SCIOP_Transport.cpp
@@ -153,7 +153,7 @@ TAO_SCIOP_Transport::send_request (TAO_Stub *stub,
int result =
tph->update_client_protocol_properties (stub,
- this,
+ this,
"sciop");
if (result == -1)
@@ -185,7 +185,7 @@ TAO_SCIOP_Transport::send_request (TAO_Stub *stub,
this->first_request_sent();
- return this->idle_after_send ();
+ return 0;
}
int
diff --git a/TAO/tao/Strategies/SHMIOP_Transport.cpp b/TAO/tao/Strategies/SHMIOP_Transport.cpp
index 77ef4957f7c..aaebc6860cf 100644
--- a/TAO/tao/Strategies/SHMIOP_Transport.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Transport.cpp
@@ -211,7 +211,7 @@ TAO_SHMIOP_Transport::send_request (TAO_Stub *stub,
return -1;
this->first_request_sent();
- return this->idle_after_send ();
+ return 0;
}
int
diff --git a/TAO/tao/Strategies/UIOP_Transport.cpp b/TAO/tao/Strategies/UIOP_Transport.cpp
index b5cfaf044dd..acf4b400bd8 100644
--- a/TAO/tao/Strategies/UIOP_Transport.cpp
+++ b/TAO/tao/Strategies/UIOP_Transport.cpp
@@ -138,9 +138,10 @@ TAO_UIOP_Transport::send_request (TAO_Stub *stub,
max_wait_time) == -1)
return -1;
+
this->first_request_sent();
- return this->idle_after_send ();
+ return 0;
}
int
diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp
index 008a091c7e1..ff3a8b1a3c7 100644
--- a/TAO/tao/Synch_Invocation.cpp
+++ b/TAO/tao/Synch_Invocation.cpp
@@ -50,6 +50,8 @@ namespace TAO
{
// @@ What is the right way to handle this error? Do we need
// to call the interceptors in this case?
+ this->resolver_.transport ()->close_connection ();
+
ACE_THROW_RETURN (CORBA::INTERNAL (TAO_DEFAULT_MINOR_CODE,
CORBA::COMPLETED_NO),
TAO_INVOKE_FAILURE);
@@ -62,7 +64,9 @@ namespace TAO
Invocation_Status s = TAO_INVOKE_FAILURE;
+
#if TAO_HAS_INTERCEPTORS == 1
+ // Start the interception point here..
s =
this->send_request_interception (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
@@ -98,11 +102,29 @@ namespace TAO
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+#if TAO_HAS_INTERCEPTORS == 1
+ // If the above call returns a restart due to connection
+ // failure then call the receive_other interception point
+ // before we leave.
+ if (s == TAO_INVOKE_RESTART)
+ {
+ s =
+ this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+#endif /*TAO_HAS_INTERCEPTORS */
+
if (s != TAO_INVOKE_SUCCESS)
return s;
countdown.update ();
+ // For some strategies one may want to release the transport
+ // back to cache. If the idling is successfull let the
+ // resolver about that.
+ if (this->resolver_.transport ()->idle_after_send ())
+ this->resolver_.transport_released ();
+
// @@ In all MT environments, there's a cancellation point lurking
// here; need to investigate. Client threads would frequently be
// canceled sometime during recv_request ... the correct action to
@@ -132,6 +154,12 @@ namespace TAO
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+ // For some strategies one may want to release the transport
+ // back to cache after receiving the reply. If the idling is
+ // successfull let the resolver about that.
+ if (this->resolver_.transport ()->idle_after_reply ())
+ this->resolver_.transport_released ();
+
#if TAO_HAS_INTERCEPTORS == 1
if (s == TAO_INVOKE_SUCCESS)
{
diff --git a/TAO/tao/Thread_Lane_Resources.cpp b/TAO/tao/Thread_Lane_Resources.cpp
index d0c9327755c..5554da114a1 100644
--- a/TAO/tao/Thread_Lane_Resources.cpp
+++ b/TAO/tao/Thread_Lane_Resources.cpp
@@ -219,6 +219,54 @@ TAO_Thread_Lane_Resources::transport_message_buffer_allocator (void)
return this->transport_message_buffer_allocator_;
}
+
+ACE_Allocator*
+TAO_Thread_Lane_Resources::output_cdr_dblock_allocator (void)
+{
+ if (this->output_cdr_dblock_allocator_ == 0)
+ {
+ // Double checked locking
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ if (this->output_cdr_dblock_allocator_ == 0)
+ this->output_cdr_dblock_allocator_ =
+ this->resource_factory ()->output_cdr_dblock_allocator ();
+ }
+
+ return this->output_cdr_dblock_allocator_;
+}
+
+
+ACE_Allocator*
+TAO_Thread_Lane_Resources::output_cdr_buffer_allocator (void)
+{
+ if (this->output_cdr_buffer_allocator_ == 0)
+ {
+ // Double checked locking
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ if (this->output_cdr_buffer_allocator_ == 0)
+ this->output_cdr_buffer_allocator_ =
+ this->resource_factory ()->output_cdr_buffer_allocator ();
+ }
+
+ return this->output_cdr_buffer_allocator_;
+}
+
+
+ACE_Allocator*
+TAO_Thread_Lane_Resources::output_cdr_msgblock_allocator (void)
+{
+ if (this->output_cdr_msgblock_allocator_ == 0)
+ {
+ // Double checked locking
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ if (this->output_cdr_msgblock_allocator_ == 0)
+ this->output_cdr_msgblock_allocator_ =
+ this->resource_factory ()->output_cdr_msgblock_allocator ();
+ }
+
+ return this->output_cdr_msgblock_allocator_;
+}
+
int
TAO_Thread_Lane_Resources::open_acceptor_registry (int ignore_address
ACE_ENV_ARG_DECL)
@@ -307,6 +355,18 @@ TAO_Thread_Lane_Resources::finalize (void)
if (this->transport_message_buffer_allocator_ != 0)
this->transport_message_buffer_allocator_->remove ();
delete this->transport_message_buffer_allocator_;
+
+ if (this->output_cdr_dblock_allocator_ != 0)
+ this->output_cdr_dblock_allocator_->remove ();
+ delete this->output_cdr_dblock_allocator_;
+
+ if (this->output_cdr_buffer_allocator_ != 0)
+ this->output_cdr_buffer_allocator_->remove ();
+ delete this->output_cdr_buffer_allocator_;
+
+ if (this->output_cdr_msgblock_allocator_ != 0)
+ this->output_cdr_msgblock_allocator_->remove ();
+ delete this->output_cdr_msgblock_allocator_;
}
void
diff --git a/TAO/tao/Thread_Lane_Resources.h b/TAO/tao/Thread_Lane_Resources.h
index ad82637ec62..12136b71915 100644
--- a/TAO/tao/Thread_Lane_Resources.h
+++ b/TAO/tao/Thread_Lane_Resources.h
@@ -102,6 +102,22 @@ public:
* Transport object. This allocator has locks.
*/
ACE_Allocator *transport_message_buffer_allocator (void);
+
+ /* Allocator is intended for allocating the ACE_Data_Blocks used in
+ * outgoing CDR streams. This allocator has locks.
+ */
+ ACE_Allocator *output_cdr_dblock_allocator (void);
+
+ /* Allocator is intended for allocating the buffers in the outgoing
+ * CDR streams. This allocator has locks.
+ */
+ ACE_Allocator *output_cdr_buffer_allocator (void);
+
+ /* Allocator is intended for allocating the ACE_Message_Blocks used
+ * in the outgoing CDR streams. This allocator is global, and has
+ * locks.
+ */
+ ACE_Allocator *output_cdr_msgblock_allocator (void);
// @}
private:
@@ -147,6 +163,13 @@ private:
//@{
ACE_Allocator *transport_message_buffer_allocator_;
//@}
+
+ /// The allocators for the output CDR streams.
+ //@{
+ ACE_Allocator *output_cdr_dblock_allocator_;
+ ACE_Allocator *output_cdr_buffer_allocator_;
+ ACE_Allocator *output_cdr_msgblock_allocator_;
+ //@}
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index 55ebbc5377d..d6fff78a27b 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -266,6 +266,12 @@ TAO_Transport::purge_entry (void)
int
TAO_Transport::make_idle (void)
{
+ if (TAO_debug_level > 3)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Transport[%d]::make_idle\n",
+ this->id ()));
+ }
return this->transport_cache_manager ().make_idle (this->cache_map_entry_);
}
diff --git a/TAO/tao/Transport_Cache_Manager.cpp b/TAO/tao/Transport_Cache_Manager.cpp
index 0ddbc9a16e2..ea55cbd3fd9 100644
--- a/TAO/tao/Transport_Cache_Manager.cpp
+++ b/TAO/tao/Transport_Cache_Manager.cpp
@@ -221,13 +221,13 @@ TAO_Transport_Cache_Manager::find_i (const TAO_Cache_ExtId &key,
{
// Successfully found a TAO_Transport.
+ entry->int_id_.recycle_state (ACE_RECYCLABLE_BUSY);
+
// NOTE: This assignment operator indirectly incurs two
// lock operations since it duplicates and releases
// TAO_Transport objects.
value = entry->int_id_;
- entry->int_id_.recycle_state (ACE_RECYCLABLE_BUSY);
-
if (TAO_debug_level > 4)
{
ACE_DEBUG ((LM_DEBUG,
diff --git a/TAO/tao/Transport_Mux_Strategy.h b/TAO/tao/Transport_Mux_Strategy.h
index 955b1f8a557..ef0b05140f0 100644
--- a/TAO/tao/Transport_Mux_Strategy.h
+++ b/TAO/tao/Transport_Mux_Strategy.h
@@ -68,12 +68,14 @@ public:
virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params) = 0;
/// Request has been just sent, but the reply is not received. Idle
- /// the transport now.
- virtual int idle_after_send (void) = 0;
+ /// the transport now. The return value indicates whether idling was
+ /// successful or not.
+ virtual bool idle_after_send (void) = 0;
/// Request is sent and the reply is received. Idle the transport
- /// now.
- virtual int idle_after_reply (void) = 0;
+ /// now. The return value indicates whether idling was successful or
+ /// not.
+ virtual bool idle_after_reply (void) = 0;
/// The transport object has closed the connection, inform all Reply
/// dispatchers and waiting strategies.
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index ceedcbead61..a91424272cc 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -782,10 +782,7 @@ TAO_Default_Resource_Factory::reclaim_reactor (ACE_Reactor *reactor)
}
-typedef ACE_Malloc<ACE_LOCAL_MEMORY_POOL,ACE_Null_Mutex> NULL_LOCK_MALLOC;
-typedef ACE_Allocator_Adapter<NULL_LOCK_MALLOC> NULL_LOCK_ALLOCATOR;
-
-#if TAO_USE_LOCAL_MEMORY_POOL
+#if TAO_USE_LOCAL_MEMORY_POOL == 1
typedef ACE_Malloc<ACE_LOCAL_MEMORY_POOL,TAO_SYNCH_MUTEX> LOCKED_MALLOC;
typedef ACE_Allocator_Adapter<LOCKED_MALLOC> LOCKED_ALLOCATOR;
#else
@@ -835,7 +832,9 @@ ACE_Allocator*
TAO_Default_Resource_Factory::output_cdr_dblock_allocator (void)
{
ACE_Allocator *allocator = 0;
- ACE_NEW_RETURN (allocator, NULL_LOCK_ALLOCATOR, 0);
+ ACE_NEW_RETURN (allocator,
+ LOCKED_ALLOCATOR,
+ 0);
return allocator;
}
@@ -843,7 +842,9 @@ ACE_Allocator *
TAO_Default_Resource_Factory::output_cdr_buffer_allocator (void)
{
ACE_Allocator *allocator = 0;
- ACE_NEW_RETURN (allocator, NULL_LOCK_ALLOCATOR, 0);
+ ACE_NEW_RETURN (allocator,
+ LOCKED_ALLOCATOR,
+ 0);
return allocator;
}
@@ -851,7 +852,9 @@ ACE_Allocator*
TAO_Default_Resource_Factory::output_cdr_msgblock_allocator (void)
{
ACE_Allocator *allocator = 0;
- ACE_NEW_RETURN (allocator, NULL_LOCK_ALLOCATOR, 0);
+ ACE_NEW_RETURN (allocator,
+ LOCKED_ALLOCATOR,
+ 0);
return allocator;
}
diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h
index 0bd007966ea..b66d2e646b9 100644
--- a/TAO/tao/orbconf.h
+++ b/TAO/tao/orbconf.h
@@ -848,5 +848,9 @@ enum TAO_Policy_Scope
# define TAO_USE_LAZY_RESOURCE_USAGE_STRATEGY 0
#endif /* TAO_USE_LAZY_RESOURCE_USAGE_STRATEGY*/
+#if !defined (TAO_USE_LOCAL_MEMORY_POOL)
+# define TAO_USE_LOCAL_MEMORY_POOL 1
+#endif /* TAO_USE_LOCAL_MEMORY_POOL */
+
#include /**/ "ace/post.h"
#endif /* TAO_ORBCONF_H */