summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2002-06-28 14:55:47 +0000
committerbala <balanatarajan@users.noreply.github.com>2002-06-28 14:55:47 +0000
commitc9dcfd9c8b6759ef90d79156428a02fade13a238 (patch)
treec61b3c3fdcf88c3948cc1a699c78901039dfe1da /TAO
parent875ba89283b7078e2354bc87cc24c7d6671472da (diff)
downloadATCD-c9dcfd9c8b6759ef90d79156428a02fade13a238.tar.gz
ChangeLogTag: Fri Jun 28 09:50:58 2002 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a12
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp3
-rw-r--r--TAO/tao/ORB_Core.cpp15
-rw-r--r--TAO/tao/ORB_Core.h26
-rw-r--r--TAO/tao/Transport.cpp11
5 files changed, 57 insertions, 10 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 3aff9db2b6d..fb8e5bb4b48 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,15 @@
+Fri Jun 28 09:50:58 2002 Balachandran Natarajan <bala@cs.wustl.edu>
+
+ * tao/ORB_Core.cpp:
+ * tao/ORB_Core.h: Added an allocator that could be used to
+ allocate buffers used for storing messages within the
+ transport. It is a bad idea to use the same allocators used for
+ the CDR streams.
+
+ * tao/Transport.cpp:
+ * tao/GIOP_Message_Base.cpp: Used the new allocators for the
+ incoming message buffers.
+
Fri Jun 28 10:08:56 2002 Carlos O'Ryan <coryan@atdesk.com>
* tests/LongUpcalls/Manager.cpp:
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index 0a560688505..1c65d8618b9 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -1502,7 +1502,8 @@ TAO_GIOP_Message_Base::make_queued_data (size_t sz)
{
// Get a node for the queue..
TAO_Queued_Data *qd =
- TAO_Queued_Data::get_queued_data (this->orb_core_->input_cdr_buffer_allocator ());
+ TAO_Queued_Data::get_queued_data (
+ this->orb_core_->transport_message_buffer_allocator ());
// @@todo: We have a similar method in Transport.cpp. Need to see how
// we can factor them out..
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index a01c543f345..e4f9f37b823 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -2242,6 +2242,21 @@ TAO_ORB_Core::output_cdr_msgblock_allocator (void)
}
+ACE_Allocator*
+TAO_ORB_Core::transport_message_buffer_allocator (void)
+{
+ if (this->orb_resources_.transport_message_buffer_allocator_ == 0)
+ {
+ // Double checked locking
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ if (this->orb_resources_.transport_message_buffer_allocator_ == 0)
+ this->orb_resources_.transport_message_buffer_allocator_ =
+ this->resource_factory ()->input_cdr_dblock_allocator ();
+ }
+ return this->orb_resources_.transport_message_buffer_allocator_;
+}
+
+
ACE_Data_Block*
TAO_ORB_Core::create_input_cdr_data_block (size_t size)
{
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 28fef4a8e97..f084e6e0319 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -125,12 +125,13 @@ private:
ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_ORB_Core_TSS_Resources&))
public:
- /**
- * @todo
- * The rest of the resources are not currently in use, just a plan
- * for the future...
- */
+ /*
+ * @@todo: All these allocators should be on a per-lane basis. Need
+ * to move it to the lanes. It makes no sense to leave it in the TSS
+ * resources class -- Bala
+ *
+ */
/// The allocators for the output CDR streams.
//@{
ACE_Allocator *output_cdr_dblock_allocator_;
@@ -145,6 +146,16 @@ public:
ACE_Allocator *input_cdr_msgblock_allocator_;
//@}
+ /// The allocators for the buffering messages in the transport.
+ //@{
+ ACE_Allocator *transport_message_buffer_allocator_;
+ //@}
+
+ /**
+ * @todo
+ * The rest of the resources are not currently in use, just a plan
+ * for the future...
+ */
/// Counter for how (nested) calls this thread has made to run the
/// event loop.
int event_loop_thread_;
@@ -457,6 +468,11 @@ public:
/// for allocating the buffers used in *incoming* CDR streams.
ACE_Allocator *input_cdr_msgblock_allocator (void);
+ /// This allocator is always global and has no locks. It is intended
+ /// for allocating the buffers used to queue messages in
+ /// transports.
+ ACE_Allocator *transport_message_buffer_allocator (void);
+
#if 0
/// @@todo: All these need to go. They were added in the first place
/// to get around a problem with input_cdr* methods. The input_cdr*
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index 19c2d84ee53..28f8c896b0b 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -764,7 +764,7 @@ TAO_Transport::handle_input_i (TAO_Resume_Handle &rh,
// Make a node of the message block..
// @@todo: Not teh right allocator......
TAO_Queued_Data qd (&message_block,
- this->orb_core_->input_cdr_buffer_allocator ());
+ this->orb_core_->transport_message_buffer_allocator ());
// Extract the data for the node..
this->messaging_object ()->get_message_data (&qd);
@@ -979,7 +979,8 @@ TAO_Transport::consolidate_message (ACE_Message_Block &incoming,
// We dont have any missing data. Just make a queued_data node with
// the existing message block and send it to the higher layers of
// the ORB.
- TAO_Queued_Data pqd (&incoming);
+ TAO_Queued_Data pqd (&incoming,
+ this->orb_core_->transport_message_buffer_allocator ());
pqd.missing_data_ = missing_data;
this->messaging_object ()->get_message_data (&pqd);
@@ -1339,10 +1340,12 @@ TAO_Transport::make_queued_data (ACE_Message_Block &incoming)
// @@ todo: Are we using the right allocator? May be not. We need to
// see how to have a general purpose allocator.
TAO_Queued_Data *qd =
- TAO_Queued_Data::get_queued_data (this->orb_core_->input_cdr_buffer_allocator ());
+ TAO_Queued_Data::get_queued_data (
+ this->orb_core_->transport_message_buffer_allocator ());
// Get the flag for the details of the data block...
- ACE_Message_Block::Message_Flags flg = incoming.self_flags ();
+ ACE_Message_Block::Message_Flags flg =
+ incoming.self_flags ();
if (ACE_BIT_DISABLED (flg,
ACE_Message_Block::DONT_DELETE))