summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a61
-rw-r--r--TAO/docs/Options.html42
-rw-r--r--TAO/tao/Asynch_Reply_Dispatcher_Base.cpp4
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp8
-rw-r--r--TAO/tao/GIOP_Message_Lite.cpp6
-rw-r--r--TAO/tao/Incoming_Message_Queue.cpp141
-rw-r--r--TAO/tao/Incoming_Message_Queue.h13
-rw-r--r--TAO/tao/Incoming_Message_Queue.inl85
-rw-r--r--TAO/tao/ORB_Core.cpp266
-rw-r--r--TAO/tao/ORB_Core.h44
-rw-r--r--TAO/tao/Resource_Factory.cpp3
-rw-r--r--TAO/tao/Resource_Factory.h3
-rw-r--r--TAO/tao/Strategies/DIOP_Transport.cpp10
-rw-r--r--TAO/tao/Synch_Reply_Dispatcher.cpp4
-rw-r--r--TAO/tao/Transport.cpp21
-rw-r--r--TAO/tao/Transport.h30
-rw-r--r--TAO/tao/default_resource.cpp22
-rw-r--r--TAO/tao/default_resource.h7
18 files changed, 389 insertions, 381 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index f9ce1b2b0f4..733795e6f2c 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,62 @@
+Thu Jun 27 16:54:42 2002 Balachandran Natarajan <bala@cs.wustl.edu>
+
+ * tao/ORB_Core.h:
+ * tao/ORB_Core.cpp: Made the following changes
+
+ - Deprecated the option -ORBResources since it served no
+ purpose. The output data was by default created on the TSS and
+ the input data into the ORB was created on the stack by
+ default. With flow control and other parameters affecting the
+ ORB they took appropriate action. The use of this option only
+ complicated code readability and was of zero use.
+
+ - The variable <use_tss_resources_> that was sprayed all around
+ the place was removed, since there is no use for it once the
+ above option was removed.
+
+ - The input CDR allocators by default will now be pointing to a
+ global memory pool. The facility to create it on the TSS has been
+ removed since this was not necessary.
+
+ - Removed 3 allocators that were added for
+ message_blocks. They were added before TAO 1.2 as a temporary
+ measure. Now that 1.2 is out, time to clean up the mess a bit
+ and deprecate some of the old features.
+
+ The above changes help us to switch back to an old scheme where
+ we used 3 allocators for the output data path and 3 allocators
+ in the input data path. This reduces confusion.
+
+ * tao/Resource_Factory.h:
+ * tao/Resource_Factory.cpp:
+ * tao/default_resources.h:
+ * tao/default_resources.cpp: Removed all references to
+ use_tss_resources and the usage of -ORBResources option.
+
+ * tao/Synch_Reply_Dispatcher.cpp:
+ * tao/Asynch_Reply_Dispatcher.cpp:
+ * tao/Transport.cpp:
+ * tao/GIOP_Message_Base.cpp:
+ * tao/GIOP_Message_Lite.cpp: Changed the usage of allocators. All
+ the allocators now point to the input CDR allocator in the
+ ORB_Core and there should be less confusion now on where the
+ memory for the data is being allocated from.
+
+ * tao/Incoming_Message_Queue.h:
+ * tao/Incoming_Message_Queue.cpp:
+ * tao/Incoming_Message_Queue.inl: The memory allocated and
+ released for the queue now comes off the memory pool instead of
+ the heap. Changes made to use the memory pool instead of heap.
+
+ * tao/Transport.h: Cosmetic fixes to the documentation.
+
+ * tao/Strategies/DIOP_Transport.cpp: Changed the usage of
+ allocators. All the allocators now point to the input CDR
+ allocator in the ORB_Core and there should be less confusion now
+ on where the memory for the data is being allocated from.
+
+ * docs/Options.html: Documented that -ORBResources is deprecated.
+
Thu Jun 27 14:55:08 2002 Ossama Othman <ossama@uci.edu>
* tao/IORTable/IOR_Table_Impl.h (TAO_IOR_Table_Impl):
@@ -18,7 +77,7 @@ Thu Jun 27 16:47:36 2002 Balachandran Natarajan <bala@cs.wustl.edu>
Thu Jun 27 10:53:51 2002 Balachandran Natarajan <bala@cs.wustl.edu>
* tests/Big_Oneways/Session_Control.cpp (session_finished):
- Pre-connect to the remote sessions before trying to run multiple
+ Pre-connect to the remote sessions before trying to run multiple
threads to them. This solves [BUG 1241] for the Big_Oneway
test.
diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html
index 7007eff63d4..c9730c2472b 100644
--- a/TAO/docs/Options.html
+++ b/TAO/docs/Options.html
@@ -335,12 +335,6 @@ the ORB.
</TD>
</TR>
<TR>
- <TD><CODE>-ORBGIOPlite</CODE></TD>
- <TD><A name="-ORBGIOPlite"></a> This option has been
- deprecated. Please see
- <i>$TAO_ROOT/docs/pluggable_messaging.html </i> for more details. </TD>
- </TR>
- <TR>
<TD><CODE>-ORBDottedDecimalAddresses</CODE> <EM>boolean (0|1)</EM></TD>
<TD><A name="-ORBDottedDecimalAddresses"></a> Use the dotted decimal
notation for addresses. This option helps to work around
@@ -387,20 +381,13 @@ the ORB.
<TR>
<TD><CODE>-ORBResources</CODE> <EM>which</EM></TD>
- <TD><A name=-ORBResources>Control the use of thread specific resources
- in the ORB.
- If (<em>which</em> = <code>global</code>) then the
- same set of resources are shared by all the threads
- that use that ORB.
- If (<em>which</em> = <code>tss</code>) then each that
- uses that ORB gets its own set of resources.
-
- <P><B>NOTE:</B> This option has almost negligible effect on the
- ORB. The right type of resources are selected by the ORB during
- runtime. For example the memory for the output datapath always
- defaults to TSS. If the message needs queuing the ORB decides to
- use global memory. The option would be deprecated in the future
- versions of TAO. </P>
+ <TD><A name=-ORBResources> <FONT COLOR=RED>This option is
+ <STRONG>deprecated</STRONG>, since this option has almost
+ negligible effect on the ORB</FONT>. The right type of resources
+ are selected by the ORB during runtime. For example the memory for
+ the output datapath always defaults to TSS. The inour data path
+ always defaults to stack for small messages and global pool for
+ larger messages. There was no effect with the use of this option.
</TD>
</TR>
@@ -443,14 +430,13 @@ would load all the options listed within "".
</TR>
<TR>
<TD><CODE>-ORBResources</CODE> <EM>which</EM></TD>
- <TD>Specify whether each thread uses a global
- (<em>which</em> = <code>global</code>) or a thread-specific
- (<em>which</em> = <code>tss</code>) instance for the resources it
- returns. The default is <CODE>global</CODE>.
- <B>NOTE:</B> This option controls the default value for
- the ORB option of the same name. The note in the ORB option
- also applies to this case too. </A>.
- </TD>
+ <TD><A name=-ORBResources> <FONT COLOR=RED>This option is
+ <STRONG>deprecated</STRONG>, since this option has almost
+ negligible effect on the ORB</FONT>. The right type of resources
+ are selected by the ORB during runtime. For example the memory for
+ the output datapath always defaults to TSS. The inour data path
+ always defaults to stack for small messages and global pool for
+ larger messages. There was no effect with the use of this option.
</TR>
<TR>
<TD><CODE>-ORBReactorMaskSignals</CODE> <EM>0/1</EM></TD>
diff --git a/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp b/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp
index f69693d0838..21439f66a2a 100644
--- a/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp
+++ b/TAO/tao/Asynch_Reply_Dispatcher_Base.cpp
@@ -19,10 +19,10 @@ TAO_Asynch_Reply_Dispatcher_Base::TAO_Asynch_Reply_Dispatcher_Base (TAO_ORB_Core
: db_ (sizeof buf_,
ACE_Message_Block::MB_DATA,
this->buf_,
- orb_core->message_block_buffer_allocator (),
+ orb_core->input_cdr_buffer_allocator (),
orb_core->locking_strategy (),
ACE_Message_Block::DONT_DELETE,
- orb_core->message_block_dblock_allocator ()),
+ orb_core->input_cdr_dblock_allocator ()),
reply_cdr_ (&db_,
ACE_Message_Block::MB_DATA,
TAO_ENCAP_BYTE_ORDER,
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp
index 952b53cbc70..0a560688505 100644
--- a/TAO/tao/GIOP_Message_Base.cpp
+++ b/TAO/tao/GIOP_Message_Base.cpp
@@ -1502,7 +1502,7 @@ 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 ();
+ TAO_Queued_Data::get_queued_data (this->orb_core_->input_cdr_buffer_allocator ());
// @@todo: We have a similar method in Transport.cpp. Need to see how
// we can factor them out..
@@ -1512,11 +1512,11 @@ TAO_GIOP_Message_Base::make_queued_data (size_t sz)
// bytes. As we may not know how many bytes will be lost, we will
// allocate ACE_CDR::MAX_ALIGNMENT extra.
ACE_Data_Block *db =
- this->orb_core_->data_block_for_message_block (sz +
- ACE_CDR::MAX_ALIGNMENT);
+ this->orb_core_->create_input_cdr_data_block (sz +
+ ACE_CDR::MAX_ALIGNMENT);
ACE_Allocator *alloc =
- this->orb_core_->message_block_msgblock_allocator ();
+ this->orb_core_->input_cdr_msgblock_allocator ();
ACE_Message_Block mb (db,
0,
diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp
index 5e02a9cada9..14747f1d897 100644
--- a/TAO/tao/GIOP_Message_Lite.cpp
+++ b/TAO/tao/GIOP_Message_Lite.cpp
@@ -1609,11 +1609,11 @@ TAO_GIOP_Message_Lite::make_queued_data (size_t sz)
// bytes. As we may not know how many bytes will be lost, we will
// allocate ACE_CDR::MAX_ALIGNMENT extra.
ACE_Data_Block *db =
- this->orb_core_->data_block_for_message_block (sz +
- ACE_CDR::MAX_ALIGNMENT);
+ this->orb_core_->create_input_cdr_data_block (sz +
+ ACE_CDR::MAX_ALIGNMENT);
ACE_Allocator *alloc =
- this->orb_core_->message_block_msgblock_allocator ();
+ this->orb_core_->input_cdr_msgblock_allocator ();
ACE_Message_Block mb (db,
0,
diff --git a/TAO/tao/Incoming_Message_Queue.cpp b/TAO/tao/Incoming_Message_Queue.cpp
index 4f825485ba2..0331c30d572 100644
--- a/TAO/tao/Incoming_Message_Queue.cpp
+++ b/TAO/tao/Incoming_Message_Queue.cpp
@@ -1,7 +1,7 @@
#include "Incoming_Message_Queue.h"
#include "ORB_Core.h"
#include "debug.h"
-
+#include "ace/Malloc_T.h"
#if !defined (__ACE_INLINE__)
# include "Incoming_Message_Queue.inl"
@@ -19,8 +19,12 @@ TAO_Incoming_Message_Queue::TAO_Incoming_Message_Queue (TAO_ORB_Core *orb_core)
TAO_Incoming_Message_Queue::~TAO_Incoming_Message_Queue (void)
{
- // Delete the QD
- if (this->size_)
+ int sz = this->size_;
+
+ // Delete all the nodes left behind
+ for (int i = 0;
+ i < sz;
+ i++)
{
TAO_Queued_Data *qd = this->dequeue_head ();
TAO_Queued_Data::release (qd);
@@ -127,8 +131,7 @@ TAO_Incoming_Message_Queue::enqueue_tail (TAO_Queued_Data *nd)
// Methods for TAO_Queued_Data
/************************************************************************/
-
-TAO_Queued_Data::TAO_Queued_Data (void)
+TAO_Queued_Data::TAO_Queued_Data (ACE_Allocator *alloc)
: msg_block_ (0),
missing_data_ (0),
byte_order_ (0),
@@ -136,11 +139,13 @@ TAO_Queued_Data::TAO_Queued_Data (void)
minor_version_ (0),
more_fragments_ (0),
msg_type_ (TAO_PLUGGABLE_MESSAGE_MESSAGERROR),
- next_ (0)
+ next_ (0),
+ allocator_ (alloc)
{
}
-TAO_Queued_Data::TAO_Queued_Data (ACE_Message_Block *mb)
+TAO_Queued_Data::TAO_Queued_Data (ACE_Message_Block *mb,
+ ACE_Allocator *alloc)
: msg_block_ (mb),
missing_data_ (0),
byte_order_ (0),
@@ -148,7 +153,8 @@ TAO_Queued_Data::TAO_Queued_Data (ACE_Message_Block *mb)
minor_version_ (0),
more_fragments_ (0),
msg_type_ (TAO_PLUGGABLE_MESSAGE_MESSAGERROR),
- next_ (0)
+ next_ (0),
+ allocator_ (alloc)
{
}
@@ -160,32 +166,117 @@ TAO_Queued_Data::TAO_Queued_Data (const TAO_Queued_Data &qd)
minor_version_ (qd.minor_version_),
more_fragments_ (qd.more_fragments_),
msg_type_ (qd.msg_type_),
- next_ (0)
+ next_ (0),
+ allocator_ (qd.allocator_)
+{
+}
+
+/*static*/
+TAO_Queued_Data *
+TAO_Queued_Data::get_queued_data (ACE_Allocator *alloc)
+{
+ TAO_Queued_Data *qd = 0;
+
+ if (alloc)
+ {
+ ACE_NEW_MALLOC_RETURN (qd,
+ ACE_static_cast (TAO_Queued_Data *,
+ alloc->malloc (sizeof (TAO_Queued_Data))),
+ TAO_Queued_Data (alloc),
+ 0);
+
+ return qd;
+ }
+
+ // No allocator, so use the global pool!
+ // @@ TODO: We should be removing this at some point of time!
+ if (TAO_debug_level == 4)
+ {
+ // This debug is for testing purposes!
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Queued_Data[%d]::get_queued_data\n",
+ "Using global pool for allocation \n"));
+ }
+
+ ACE_NEW_RETURN (qd,
+ TAO_Queued_Data,
+ 0);
+
+ return qd;
+}
+
+/*static*/
+void
+TAO_Queued_Data::release (TAO_Queued_Data *qd)
{
+ //// TODO
+ ACE_Message_Block::release (qd->msg_block_);
+
+ if (qd->allocator_)
+ {
+ ACE_DES_FREE (qd,
+ qd->allocator_->free,
+ TAO_Queued_Data);
+
+ return;
+ }
+
+ // @@todo: Need to be removed at some point of time!
+ if (TAO_debug_level == 4)
+ {
+ // This debug is for testing purposes!
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Queued_Data[%d]::release\n",
+ "Using global pool for releasing \n"));
+ }
+ delete qd;
+
}
-/*static*/ void
-TAO_Queued_Data::replace_data_block (ACE_Message_Block &mb)
+TAO_Queued_Data *
+TAO_Queued_Data::duplicate (TAO_Queued_Data &sqd)
{
- size_t newsize =
- ACE_CDR::total_length (&mb, 0) + ACE_CDR::MAX_ALIGNMENT;
+ // Check to see if the underlying block is on the stack. If not it
+ // is fine. If the datablock is on stack, try to make a copy of that
+ // before doing a duplicate.
+ // @@ todo: Theoretically this should be within the Message Block,
+ // but we dont have much scope to do this in that mess. Probably in
+ // the next stage of MB rewrite we should be okay
+ ACE_Message_Block::Message_Flags fl =
+ sqd.msg_block_->self_flags ();
+
+ if (ACE_BIT_ENABLED (fl,
+ ACE_Message_Block::DONT_DELETE))
+ (void) TAO_Queued_Data::replace_data_block (*sqd.msg_block_);
+
- ACE_Data_Block *db =
- mb.data_block ()->clone_nocopy ();
+ TAO_Queued_Data *qd = 0;
- if (db->size (newsize) == -1)
- return;
+ if (sqd.allocator_)
+ {
+ ACE_NEW_MALLOC_RETURN (qd,
+ ACE_static_cast(TAO_Queued_Data *,
+ sqd.allocator_->malloc (sizeof (TAO_Queued_Data))),
+ TAO_Queued_Data (sqd.allocator_),
+ 0);
- ACE_Message_Block tmp (db);
- ACE_CDR::mb_align (&tmp);
+ return qd;
+ }
- tmp.copy (mb.rd_ptr (), mb.length());
- mb.data_block (tmp.data_block ()->duplicate ());
+ // No allocator, so use the global pool!
+ // @@ TODO: We should be removing this at some point of time!
+ if (TAO_debug_level == 4)
+ {
+ // This debug is for testing purposes!
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Queued_Data[%d]::duplicate\n",
+ "Using global pool for allocation \n"));
+ }
- mb.rd_ptr (tmp.rd_ptr ());
- mb.wr_ptr (tmp.wr_ptr ());
+ ACE_NEW_RETURN (qd,
+ TAO_Queued_Data (sqd),
+ 0);
- // Remove the DONT_DELETE flags from mb
- mb.clr_self_flags (ACE_Message_Block::DONT_DELETE);
+ return qd;
}
diff --git a/TAO/tao/Incoming_Message_Queue.h b/TAO/tao/Incoming_Message_Queue.h
index 4a4d6109608..5c03cbe12af 100644
--- a/TAO/tao/Incoming_Message_Queue.h
+++ b/TAO/tao/Incoming_Message_Queue.h
@@ -22,6 +22,7 @@
/// Forward declarations
class ACE_Data_Block;
+class ACE_Allocator;
class TAO_ORB_Core;
class TAO_Queued_Data;
class TAO_Transport;
@@ -52,7 +53,8 @@ class TAO_Transport;
class TAO_Export TAO_Incoming_Message_Queue
{
public:
- /// Contructor.
+
+ /// Constructor.
TAO_Incoming_Message_Queue (TAO_ORB_Core *orb_core);
/// Destructor.
@@ -122,16 +124,16 @@ class TAO_Export TAO_Queued_Data
{
public:
/// Default Constructor
- TAO_Queued_Data (void);
+ TAO_Queued_Data (ACE_Allocator *alloc = 0);
/// Constructor.
- TAO_Queued_Data (ACE_Message_Block *mb);
+ TAO_Queued_Data (ACE_Message_Block *mb, ACE_Allocator *alloc = 0);
/// Copy constructor.
TAO_Queued_Data (const TAO_Queued_Data &qd);
/// Creation and deletion of a node in the queue.
- static TAO_Queued_Data* get_queued_data (void);
+ static TAO_Queued_Data* get_queued_data (ACE_Allocator *alloc = 0);
static void release (TAO_Queued_Data *qd);
@@ -171,6 +173,9 @@ private:
/// Replace the datablock with a one allocated on the heap or
/// allocator
static void replace_data_block (ACE_Message_Block &mb);
+
+private:
+ ACE_Allocator *allocator_;
};
diff --git a/TAO/tao/Incoming_Message_Queue.inl b/TAO/tao/Incoming_Message_Queue.inl
index a1e68a9386f..d67bd485383 100644
--- a/TAO/tao/Incoming_Message_Queue.inl
+++ b/TAO/tao/Incoming_Message_Queue.inl
@@ -1,62 +1,9 @@
// -*- C++ -*-
//$Id$
-/************************************************************************/
-// Methods for TAO_Queued_Data
-/************************************************************************/
-/*static*/
-ACE_INLINE TAO_Queued_Data *
-TAO_Queued_Data::get_queued_data (void)
-{
- // @@TODO: Use the global pool for allocationg...
- TAO_Queued_Data *qd = 0;
- ACE_NEW_RETURN (qd,
- TAO_Queued_Data,
- 0);
-
- return qd;
-}
-
-/*static*/
-ACE_INLINE void
-TAO_Queued_Data::release (TAO_Queued_Data *qd)
-{
- ACE_Message_Block::release (qd->msg_block_);
-
- // @@TODO: Use the global pool for releasing..
- delete qd;
-}
-
-
-ACE_INLINE TAO_Queued_Data *
-TAO_Queued_Data::duplicate (TAO_Queued_Data &sqd)
-{
- // Check to see if the underlying block is on the stack. If not it
- // is fine. If the datablock is on stack, try to make a copy of that
- // befor doing a duplicate.
- // @@ todo: Theoretically this should be within the Message Block,
- // but we dont have much scope to do this in that mess. Probably in
- // the next stage of MB rewrite we should be okay
- ACE_Message_Block::Message_Flags fl =
- sqd.msg_block_->self_flags ();
-
- if (ACE_BIT_ENABLED (fl,
- ACE_Message_Block::DONT_DELETE))
- (void) TAO_Queued_Data::replace_data_block (*sqd.msg_block_);
-
-
- // @@TODO: Use the pool for allocation...
- TAO_Queued_Data *qd = 0;
- ACE_NEW_RETURN (qd,
- TAO_Queued_Data (sqd),
- 0);
-
- return qd;
-}
-
+// -*- C++ -*-
/************************************************************************/
// Methods for TAO_Incoming_Message_Queue
/************************************************************************/
-
ACE_INLINE CORBA::ULong
TAO_Incoming_Message_Queue::queue_length (void)
{
@@ -120,3 +67,33 @@ TAO_Incoming_Message_Queue::get_node (void)
{
return TAO_Queued_Data::get_queued_data ();
}
+
+/************************************************************************/
+// Methods for TAO_Queued_Data
+/************************************************************************/
+
+/*static*/
+ACE_INLINE void
+TAO_Queued_Data::replace_data_block (ACE_Message_Block &mb)
+{
+ size_t newsize =
+ ACE_CDR::total_length (&mb, 0) + ACE_CDR::MAX_ALIGNMENT;
+
+ ACE_Data_Block *db =
+ mb.data_block ()->clone_nocopy ();
+
+ if (db->size (newsize) == -1)
+ return;
+
+ ACE_Message_Block tmp (db);
+ ACE_CDR::mb_align (&tmp);
+
+ tmp.copy (mb.rd_ptr (), mb.length());
+ mb.data_block (tmp.data_block ()->duplicate ());
+
+ mb.rd_ptr (tmp.rd_ptr ());
+ mb.wr_ptr (tmp.wr_ptr ());
+
+ // Remove the DONT_DELETE flags from mb
+ mb.clr_self_flags (ACE_Message_Block::DONT_DELETE);
+}
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 2fba92b61e6..a01c543f345 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -122,9 +122,12 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
object_ref_table_ (),
orbid_ (ACE_OS::strdup (orbid ? orbid : "")),
resource_factory_ (0),
+#if 0
+ /// @@todo:Need to go one day
message_block_dblock_allocator_ (0),
message_block_buffer_allocator_ (0),
message_block_msgblock_allocator_ (0),
+#endif /*if 0*/
// server_id_ (0),
client_factory_ (0),
server_factory_ (0),
@@ -149,7 +152,6 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
from_unicode_ (0),
to_unicode_ (0),
tss_cleanup_funcs_ (),
- use_tss_resources_ (0),
tss_resources_ (),
orb_resources_ (),
has_shutdown_ (1), // Start the ORB in a "shutdown" state. Only
@@ -317,10 +319,6 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL)
int std_profile_components = 0;
#endif /* TAO_STD_PROFILE_COMPONENTS */
- int use_tss_resources = -1;
- // -1 is unknown, default to what the resource factory sets.
- // @@ This is just for backwards compatibility.
-
// Copy command line parameter not to use original.
ACE_Argv_Type_Converter command_line(argc, argv);
@@ -334,19 +332,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL)
////////////////////////////////////////////////////////////////
// begin with the 'parameterless' flags //
////////////////////////////////////////////////////////////////
- if (arg_shifter.cur_arg_strncasecmp (ACE_LIB_TEXT("-ORBGIOPlite")) == 0)
- {
- // @@ This will have to change since gioplite
- // will be considered as an alternate ORB
- // messaging protocols.
- // giop_lite = 1;
- ACE_DEBUG ((LM_WARNING,
- ACE_LIB_TEXT ("(%P|%t) This option has been deprecated \n")
- ACE_LIB_TEXT ("Please use svc.conf file to load the protcol \n")));
-
- arg_shifter.consume_arg ();
- }
- else if ((current_arg = arg_shifter.get_the_parameter
+ if ((current_arg = arg_shifter.get_the_parameter
(ACE_LIB_TEXT("-ORBDottedDecimalAddresses"))))
{
// Use dotted decimal addresses
@@ -673,11 +659,9 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL)
else if ((current_arg = arg_shifter.get_the_parameter
(ACE_LIB_TEXT("-ORBResources"))))
{
- const ACE_TCHAR *opt = current_arg;
- if (ACE_OS::strcasecmp (opt, ACE_LIB_TEXT("global")) == 0)
- use_tss_resources = 0;
- else if (ACE_OS::strcasecmp (opt, ACE_LIB_TEXT("tss")) == 0)
- use_tss_resources = 1;
+ ACE_DEBUG ((LM_WARNING,
+ ACE_LIB_TEXT ("This option has been deprecated\n")));
+
arg_shifter.consume_arg ();
}
else if ((current_arg = arg_shifter.get_the_parameter
@@ -863,11 +847,6 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL)
-1);
}
- if (use_tss_resources == -1)
- this->use_tss_resources_ = trf->use_tss_resources ();
- else
- this->use_tss_resources_ = use_tss_resources;
-
// @@ ????
// Make sure the reactor is initialized...
ACE_Reactor *reactor = this->reactor ();
@@ -1111,6 +1090,8 @@ TAO_ORB_Core::fini (void)
(void) TAO_Internal::close_services ();
+#if 0
+ // @@todo: Need to go someday!
if (this->message_block_dblock_allocator_)
this->message_block_dblock_allocator_->remove ();
delete this->message_block_dblock_allocator_;
@@ -1122,6 +1103,7 @@ TAO_ORB_Core::fini (void)
if (this->message_block_msgblock_allocator_)
this->message_block_msgblock_allocator_->remove ();
delete this->message_block_msgblock_allocator_;
+#endif /*if 0*/
delete this;
@@ -2158,30 +2140,8 @@ TAO_ORB_Core::list_initial_references (ACE_ENV_SINGLE_ARG_DECL)
// ****************************************************************
ACE_Allocator*
-TAO_ORB_Core::input_cdr_dblock_allocator_i (TAO_ORB_Core_TSS_Resources *tss)
-{
- if (tss->input_cdr_dblock_allocator_ == 0)
- tss->input_cdr_dblock_allocator_ =
- this->resource_factory ()->input_cdr_dblock_allocator ();
-
- return tss->input_cdr_dblock_allocator_;
-}
-
-ACE_Allocator*
TAO_ORB_Core::input_cdr_dblock_allocator (void)
{
- if (this->use_tss_resources_)
- {
- TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) %p\n"),
- ACE_LIB_TEXT ("TAO_ORB_Core::input_cdr_dblock_allocator (); ")
- ACE_LIB_TEXT ("no more TSS keys")),
- 0);
- return this->input_cdr_dblock_allocator_i (tss);
- }
-
if (this->orb_resources_.input_cdr_dblock_allocator_ == 0)
{
// Double checked locking
@@ -2193,32 +2153,10 @@ TAO_ORB_Core::input_cdr_dblock_allocator (void)
return this->orb_resources_.input_cdr_dblock_allocator_;
}
-ACE_Allocator*
-TAO_ORB_Core::input_cdr_buffer_allocator_i (TAO_ORB_Core_TSS_Resources *tss)
-{
- if (tss->input_cdr_buffer_allocator_ == 0)
- tss->input_cdr_buffer_allocator_ =
- this->resource_factory ()->input_cdr_buffer_allocator ();
-
- return tss->input_cdr_buffer_allocator_;
-}
ACE_Allocator*
TAO_ORB_Core::input_cdr_buffer_allocator (void)
{
- if (this->use_tss_resources_)
- {
- TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) %p\n"),
- ACE_LIB_TEXT ("TAO_ORB_Core::input_cdr_buffer_allocator (); ")
- ACE_LIB_TEXT ("no more TSS keys")),
- 0);
-
- return this->input_cdr_buffer_allocator_i (tss);
- }
-
if (this->orb_resources_.input_cdr_buffer_allocator_ == 0)
{
// Double checked locking
@@ -2230,31 +2168,10 @@ TAO_ORB_Core::input_cdr_buffer_allocator (void)
return this->orb_resources_.input_cdr_buffer_allocator_;
}
-ACE_Allocator*
-TAO_ORB_Core::input_cdr_msgblock_allocator_i (TAO_ORB_Core_TSS_Resources *tss)
-{
- if (tss->input_cdr_msgblock_allocator_ == 0)
- tss->input_cdr_msgblock_allocator_ =
- this->resource_factory ()->input_cdr_msgblock_allocator ();
-
- return tss->input_cdr_msgblock_allocator_;
-}
ACE_Allocator*
TAO_ORB_Core::input_cdr_msgblock_allocator (void)
{
- if (this->use_tss_resources_)
- {
- TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) %p\n"),
- ACE_LIB_TEXT ("TAO_ORB_Core::input_cdr_msgblock_allocator (); ")
- ACE_LIB_TEXT ("no more TSS keys")),
- 0);
- return this->input_cdr_msgblock_allocator_i (tss);
- }
-
if (this->orb_resources_.input_cdr_msgblock_allocator_ == 0)
{
// Double checked locking
@@ -2270,110 +2187,61 @@ ACE_Allocator*
TAO_ORB_Core::output_cdr_dblock_allocator (void)
{
-#if 0
- if (this->use_tss_resources_)
-#endif /* 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 ();
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) %p\n"),
- ACE_LIB_TEXT ("TAO_ORB_Core::output_cdr_dblock_allocator (); ")
- ACE_LIB_TEXT ("no more TSS keys")),
- 0);
-
- if (tss->output_cdr_dblock_allocator_ == 0)
- tss->output_cdr_dblock_allocator_ =
- this->resource_factory ()->output_cdr_dblock_allocator ();
-
- return tss->output_cdr_dblock_allocator_;
- }
+ // 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 ();
+ if (tss == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) %p\n"),
+ ACE_LIB_TEXT ("TAO_ORB_Core::output_cdr_dblock_allocator (); ")
+ ACE_LIB_TEXT ("no more TSS keys")),
+ 0);
-#if 0
- if (this->orb_resources_.output_cdr_dblock_allocator_ == 0)
- {
- // Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
- if (this->orb_resources_.output_cdr_dblock_allocator_ == 0)
- this->orb_resources_.output_cdr_dblock_allocator_ =
- this->resource_factory ()->output_cdr_dblock_allocator ();
- }
- return this->orb_resources_.output_cdr_dblock_allocator_;
-#endif /* 0 */
+ if (tss->output_cdr_dblock_allocator_ == 0)
+ tss->output_cdr_dblock_allocator_ =
+ this->resource_factory ()->output_cdr_dblock_allocator ();
+
+ return tss->output_cdr_dblock_allocator_;
}
ACE_Allocator*
TAO_ORB_Core::output_cdr_buffer_allocator (void)
{
-#if 0
- if (this->use_tss_resources_)
-#endif /* 0 */
- {
- TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) %p\n"),
- ACE_LIB_TEXT ("TAO_ORB_Core::input_cdr_buffer_allocator (); ")
- ACE_LIB_TEXT ("no more TSS keys")),
- 0);
-
- if (tss->output_cdr_buffer_allocator_ == 0)
- tss->output_cdr_buffer_allocator_ =
- this->resource_factory ()->output_cdr_buffer_allocator ();
-
- return tss->output_cdr_buffer_allocator_;
- }
+ TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
+ if (tss == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) %p\n"),
+ ACE_LIB_TEXT ("TAO_ORB_Core::input_cdr_buffer_allocator (); ")
+ ACE_LIB_TEXT ("no more TSS keys")),
+ 0);
-#if 0
- if (this->orb_resources_.output_cdr_buffer_allocator_ == 0)
- {
- // Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
- if (this->orb_resources_.output_cdr_buffer_allocator_ == 0)
- this->orb_resources_.output_cdr_buffer_allocator_ =
- this->resource_factory ()->output_cdr_buffer_allocator ();
- }
- return this->orb_resources_.output_cdr_buffer_allocator_;
-#endif /* 0 */
+ if (tss->output_cdr_buffer_allocator_ == 0)
+ tss->output_cdr_buffer_allocator_ =
+ this->resource_factory ()->output_cdr_buffer_allocator ();
+
+ return tss->output_cdr_buffer_allocator_;
}
+
ACE_Allocator*
TAO_ORB_Core::output_cdr_msgblock_allocator (void)
{
-#if 0
- if (this->use_tss_resources_)
-#endif /* 0 */
- {
- TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) %p\n"),
- ACE_LIB_TEXT ("TAO_ORB_Core::output_cdr_msgblock_allocator (); ")
- ACE_LIB_TEXT ("no more TSS keys")),
- 0);
-
- if (tss->output_cdr_msgblock_allocator_ == 0)
- tss->output_cdr_msgblock_allocator_ =
- this->resource_factory ()->output_cdr_msgblock_allocator ();
-
- return tss->output_cdr_msgblock_allocator_;
- }
+ TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
+ if (tss == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) %p\n"),
+ ACE_LIB_TEXT ("TAO_ORB_Core::output_cdr_msgblock_allocator (); ")
+ ACE_LIB_TEXT ("no more TSS keys")),
+ 0);
-#if 0
- if (this->orb_resources_.output_cdr_msgblock_allocator_ == 0)
- {
- // Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
- if (this->orb_resources_.output_cdr_msgblock_allocator_ == 0)
- this->orb_resources_.output_cdr_msgblock_allocator_ =
- this->resource_factory ()->output_cdr_msgblock_allocator ();
- }
- return this->orb_resources_.output_cdr_msgblock_allocator_;
-#endif /* 0 */
+ if (tss->output_cdr_msgblock_allocator_ == 0)
+ tss->output_cdr_msgblock_allocator_ =
+ this->resource_factory ()->output_cdr_msgblock_allocator ();
+
+ return tss->output_cdr_msgblock_allocator_;
}
+
ACE_Data_Block*
TAO_ORB_Core::create_input_cdr_data_block (size_t size)
{
@@ -2381,30 +2249,10 @@ TAO_ORB_Core::create_input_cdr_data_block (size_t size)
ACE_Allocator *dblock_allocator;
ACE_Allocator *buffer_allocator;
- if (this->use_tss_resources_)
- {
- TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) %p\n"),
- ACE_LIB_TEXT ("TAO_ORB_Core::create_input_cdr_data_block (); ")
- ACE_LIB_TEXT ("no more TSS keys")),
- 0);
-
- dblock_allocator =
- this->input_cdr_dblock_allocator_i (tss);
- buffer_allocator =
- this->input_cdr_buffer_allocator_i (tss);
-
- }
- else
- {
- dblock_allocator =
- this->input_cdr_dblock_allocator ();
- buffer_allocator =
- this->input_cdr_buffer_allocator ();
-
- }
+ dblock_allocator =
+ this->input_cdr_dblock_allocator ();
+ buffer_allocator =
+ this->input_cdr_buffer_allocator ();
ACE_Lock* lock_strategy = 0;
if (this->resource_factory ()->use_locked_data_blocks ())
@@ -2418,6 +2266,10 @@ TAO_ORB_Core::create_input_cdr_data_block (size_t size)
lock_strategy);
}
+#if 0
+// @@todo: This will go off after sometime. We may no longer need
+// this, since we could as well use the input_cdr* for use.
+
ACE_Data_Block *
TAO_ORB_Core::data_block_for_message_block (size_t size)
{
@@ -2484,6 +2336,7 @@ TAO_ORB_Core::message_block_msgblock_allocator (void)
return this->message_block_msgblock_allocator_;
}
+#endif /*if 0*/
ACE_Data_Block *
TAO_ORB_Core::create_data_block_i (size_t size,
@@ -2782,6 +2635,7 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void)
output_cdr_msgblock_allocator_ (0),
input_cdr_dblock_allocator_ (0),
input_cdr_buffer_allocator_ (0),
+ input_cdr_msgblock_allocator_ (0),
event_loop_thread_ (0),
client_leader_thread_ (0),
lane_ (0),
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 498a8ea5600..28fef4a8e97 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -444,19 +444,28 @@ public:
/// streams.
ACE_Allocator *output_cdr_msgblock_allocator (void);
- /// This allocator maybe TSS or global, may or may not have
- /// locks. It is intended for allocating the ACE_Data_Blocks used in
- /// *outgoing* / CDR streams.
+ /// This allocator is global, may or may not have locks. It is
+ /// intended for allocating the ACE_Data_Blocks used in *incoming*
+ /// CDR streams.
ACE_Allocator *input_cdr_dblock_allocator (void);
- /// This allocator is always TSS and has no locks. It is intended
- /// for allocating the buffers used in *outgoing* CDR streams.
+ /// This allocator is always global and has no locks. It is intended
+ /// for allocating the buffers used in *incoming* CDR streams.
ACE_Allocator *input_cdr_buffer_allocator (void);
- /// This allocator is always TSS and has no locks. It is intended
- /// for allocating the buffers used in *outgoing* CDR streams.
+ /// This allocator is always global and has no locks. It is intended
+ /// for allocating the buffers used in *incoming* CDR streams.
ACE_Allocator *input_cdr_msgblock_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*
+ /// methods would access from TSS if an option is set. Since some
+ /// portions of the ORB didnt require memory from TSS, we had these
+ /// new set of methods. Now that the semantics are changed for
+ /// input_cdr* methods, these methods may not be required. We can
+ /// remove them at a later date!
+
/// This allocator is global, may or may not have locks. It is
/// intended for ACE_Data_Blocks used in message blocks or CDR
/// streams that have no relation with the life of threads,
@@ -475,6 +484,12 @@ public:
/// something like used in a class on a per connection basis
ACE_Allocator *message_block_msgblock_allocator (void);
+ /// The data blocks returned have memeory from the global pool. Will
+ /// not get anything from the TSS even if it is available.
+ ACE_Data_Block *data_block_for_message_block (size_t size);
+
+#endif /*if 0*/
+
/// The Message Blocks used for input CDRs must have appropiate
/// locking strategies.
ACE_Data_Block *create_input_cdr_data_block (size_t size);
@@ -483,11 +498,6 @@ public:
/// Return the locking strategy used for the data blocks.
ACE_Lock *locking_strategy (void);
- /// The data blocks returned have memeory from the global pool. Will
- /// not get anything from the TSS even if it is available.
- ACE_Data_Block *data_block_for_message_block (size_t size);
-
-
#if (TAO_HAS_CORBA_MESSAGING == 1)
/// Accessor method for the default_policies_
@@ -933,6 +943,9 @@ protected:
/// destructor.
int fini (void);
+#if 0
+ /// @@todo: All these need to go! We dont put input cdr's on the TSS
+ /// anyway.
/// Implement the input_cdr_*_allocator() routines using pre-fetched
/// TSS resources. This minimizes the number of calls to them.
//@{
@@ -941,6 +954,7 @@ protected:
ACE_Allocator *input_cdr_msgblock_allocator_i (TAO_ORB_Core_TSS_Resources *);
//@}
+#endif /*if 0*/
/// Routine that creates a ACE_Data_Block given the lock and allocators.
ACE_Data_Block *create_data_block_i (size_t size,
ACE_Allocator *buffer_allocator,
@@ -1071,12 +1085,15 @@ protected:
/// Handle to the factory for resource information..
TAO_Resource_Factory *resource_factory_;
+#if 0
+ /// @@todo: All these need to go!
/// The allocators for the message blocks
//@{
ACE_Allocator *message_block_dblock_allocator_;
ACE_Allocator *message_block_buffer_allocator_;
ACE_Allocator *message_block_msgblock_allocator_;
//@}
+#endif /*if 0*/
// Name of the endpoint selector factory that needs to be instantiated.
// The default value is "Default_Endpoint_Selector_Factory". If
@@ -1220,9 +1237,6 @@ protected:
/// objects stored in TAO's TSS resources.
TAO_Cleanup_Func_Registry tss_cleanup_funcs_;
- /// If 1 then this ORB uses thread-specific resources
- int use_tss_resources_;
-
/// This is where the tss resources for this ORB are stored.
ACE_TSS_TYPE (TAO_ORB_Core_TSS_Resources) tss_resources_;
diff --git a/TAO/tao/Resource_Factory.cpp b/TAO/tao/Resource_Factory.cpp
index d7395a398b8..22e921674a8 100644
--- a/TAO/tao/Resource_Factory.cpp
+++ b/TAO/tao/Resource_Factory.cpp
@@ -57,11 +57,14 @@ TAO_Resource_Factory::~TAO_Resource_Factory (void)
{
}
+#if 0
+// @@todo: Need to go at a later date!
int
TAO_Resource_Factory::use_tss_resources (void) const
{
return 0;
}
+#endif /*if 0*/
int
TAO_Resource_Factory::use_locked_data_blocks (void) const
diff --git a/TAO/tao/Resource_Factory.h b/TAO/tao/Resource_Factory.h
index 53494ecaaa6..3cf5e3d286e 100644
--- a/TAO/tao/Resource_Factory.h
+++ b/TAO/tao/Resource_Factory.h
@@ -119,9 +119,12 @@ public:
// = Resource Retrieval
+#if 0
+ /// @@ todo: Need to go at a later date!
/// @@ Backwards compatibility, return 1 if the ORB core should use
/// TSS resources
virtual int use_tss_resources (void) const;
+#endif /*if 0*/
/// @@ Backwards compatibility, return 1 if the ORB core should use
/// Locked_Data_Blocks
diff --git a/TAO/tao/Strategies/DIOP_Transport.cpp b/TAO/tao/Strategies/DIOP_Transport.cpp
index 5981811452d..da1d4fb87dd 100644
--- a/TAO/tao/Strategies/DIOP_Transport.cpp
+++ b/TAO/tao/Strategies/DIOP_Transport.cpp
@@ -83,8 +83,8 @@ TAO_DIOP_Transport::send_i (iovec *iov, int iovcnt,
bytes_to_send += iov[i].iov_len;
this->connection_handler_->dgram ().send (iov,
- iovcnt,
- addr);
+ iovcnt,
+ addr);
// @@ Michael:
// Always return a positive number of bytes sent, as we do
// not handle sending errors in DIOP.
@@ -168,15 +168,15 @@ TAO_DIOP_Transport::handle_input_i (TAO_Resume_Handle &rh,
ACE_Data_Block db (sizeof (buf),
ACE_Message_Block::MB_DATA,
buf,
- this->orb_core_->message_block_buffer_allocator (),
+ this->orb_core_->input_cdr_buffer_allocator (),
this->orb_core_->locking_strategy (),
ACE_Message_Block::DONT_DELETE,
- this->orb_core_->message_block_dblock_allocator ());
+ this->orb_core_->input_cdr_dblock_allocator ());
// Create a message block
ACE_Message_Block message_block (&db,
ACE_Message_Block::DONT_DELETE,
- this->orb_core_->message_block_msgblock_allocator ());
+ this->orb_core_->input_cdr_msgblock_allocator ());
// Align the message block
diff --git a/TAO/tao/Synch_Reply_Dispatcher.cpp b/TAO/tao/Synch_Reply_Dispatcher.cpp
index 3d2f7ea3628..1fcaae52e91 100644
--- a/TAO/tao/Synch_Reply_Dispatcher.cpp
+++ b/TAO/tao/Synch_Reply_Dispatcher.cpp
@@ -18,10 +18,10 @@ TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher (
db_ (sizeof buf_,
ACE_Message_Block::MB_DATA,
this->buf_,
- this->orb_core_->message_block_buffer_allocator (),
+ this->orb_core_->input_cdr_buffer_allocator (),
this->orb_core_->locking_strategy (),
ACE_Message_Block::DONT_DELETE,
- this->orb_core_->message_block_dblock_allocator ()),
+ this->orb_core_->input_cdr_dblock_allocator ()),
reply_cdr_ (&db_,
ACE_Message_Block::DONT_DELETE,
TAO_ENCAP_BYTE_ORDER,
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index 746b72cc160..19c2d84ee53 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -700,15 +700,15 @@ TAO_Transport::handle_input_i (TAO_Resume_Handle &rh,
ACE_Data_Block db (sizeof (buf),
ACE_Message_Block::MB_DATA,
buf,
- this->orb_core_->message_block_buffer_allocator (),
+ this->orb_core_->input_cdr_buffer_allocator (),
this->orb_core_->locking_strategy (),
ACE_Message_Block::DONT_DELETE,
- this->orb_core_->message_block_dblock_allocator ());
+ this->orb_core_->input_cdr_dblock_allocator ());
// Create a message block
ACE_Message_Block message_block (&db,
ACE_Message_Block::DONT_DELETE,
- this->orb_core_->message_block_msgblock_allocator ());
+ this->orb_core_->input_cdr_msgblock_allocator ());
// Align the message block
@@ -762,7 +762,9 @@ TAO_Transport::handle_input_i (TAO_Resume_Handle &rh,
}
// Make a node of the message block..
- TAO_Queued_Data qd (&message_block);
+ // @@todo: Not teh right allocator......
+ TAO_Queued_Data qd (&message_block,
+ this->orb_core_->input_cdr_buffer_allocator ());
// Extract the data for the node..
this->messaging_object ()->get_message_data (&qd);
@@ -1334,7 +1336,10 @@ TAO_Queued_Data *
TAO_Transport::make_queued_data (ACE_Message_Block &incoming)
{
// Get an instance of TAO_Queued_Data
- TAO_Queued_Data *qd = TAO_Queued_Data::get_queued_data ();
+ // @@ 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 ());
// Get the flag for the details of the data block...
ACE_Message_Block::Message_Flags flg = incoming.self_flags ();
@@ -1351,12 +1356,12 @@ TAO_Transport::make_queued_data (ACE_Message_Block &incoming)
// on an 8 byte boundary. Hence create a data block for more
// than the actual length
ACE_Data_Block *db =
- this->orb_core_->data_block_for_message_block (incoming.length ()+
- ACE_CDR::MAX_ALIGNMENT);
+ this->orb_core_->create_input_cdr_data_block (incoming.length ()+
+ ACE_CDR::MAX_ALIGNMENT);
// Get the allocator..
ACE_Allocator *alloc =
- this->orb_core_->message_block_msgblock_allocator ();
+ this->orb_core_->input_cdr_msgblock_allocator ();
// Make message block..
ACE_Message_Block mb (db,
diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h
index 84f426424d0..7c1157a1152 100644
--- a/TAO/tao/Transport.h
+++ b/TAO/tao/Transport.h
@@ -135,8 +135,8 @@ protected:
* - A per-message 'waiting object'
* - A per-message timeout
*
- * The Transport object provides a single method to send messages
- * (send_message ()).
+ * The Transport object provides a single method to send request
+ * messages (send_request_message ()).
*
* <H3>The incoming data path:</H3>
*
@@ -170,7 +170,7 @@ protected:
* to the higher layers of the ORB. The problems stem from the
* following
* (a) Data is bigger than the buffer that we have on stack
- * (b) Transports like TCP do not guarentee availability of the whole
+ * (b) Transports like TCP do not guarantee availability of the whole
* chunk of data in one shot. Data could trickle in byte by byte.
* (c) Single read gives multiple messages
*
@@ -199,9 +199,30 @@ protected:
* message from the queue and processes that. Once the queue
* is drained the last thread resumes the handle.
*
+ * <H3> Sending Replies </H3>
+ *
+ * We could use the outgoing path of the ORB to send replies. This
+ * would allow us to reuse most of the code in the outgoing data
+ * path. We were doing this till TAO-1.2.3. We run in to
+ * problems. When wrinting the reply gets flow controlled, the ORB
+ * tries to flush the message by going into the reactor. This resulted
+ * in unnecessary nesting. The thread that gets into the Reactor could
+ * potentially handle other messages (incoming or outgoing) and the
+ * stack starts growing leading to crashes.
+ *
+ * <H4> Solution to the nesting problem </H4>
+ *
+ * If a thread sending replies gets flow controlled, the ORB would be
+ * healthier if it just copies the message and leaves it in the
+ * queue. It can go back to wait in the reactor by exiting the
+ * loop. The underlying assumption is that the thread trying to send a
+ * reply is doing so in the first place it was waiting in the reactor
+ to send
+ *
+ *
* <B>See Also:</B>
*
- * http://ace.cs.wustl.edu/cvsweb/ace-latest.cgi/ACE_wrappers/TAO/docs/pluggable_protocols/index.html
+ * http://deuce.doc.wustl.edu/cvsweb/ace-latest.cgi/ACE_wrappers/TAO/docs/pluggable_protocols/index.html
*
*/
class TAO_Export TAO_Transport : private TAO_Synch_Refcountable
@@ -574,7 +595,6 @@ public:
* must be 'formatted', i.e. the message_size field in the GIOP
* header can finally be set to the proper value.
*
- * @todo Another generic method, move to TAO_Transport.
*/
// @@ lockme
virtual int send_message (TAO_OutputCDR &stream,
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index 593d1a5a4f9..841bd256511 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -33,8 +33,7 @@ ACE_RCSID (tao,
"$Id$")
TAO_Default_Resource_Factory::TAO_Default_Resource_Factory (void)
- : use_tss_resources_ (0),
- use_locked_data_blocks_ (1),
+ : use_locked_data_blocks_ (1),
parser_names_count_ (0),
parser_names_ (0),
protocol_factories_ (),
@@ -121,19 +120,9 @@ TAO_Default_Resource_Factory::init (int argc, ACE_TCHAR *argv[])
ACE_LIB_TEXT("-ORBResources")) == 0)
{
curarg++;
- if (curarg < argc)
- {
- ACE_TCHAR* name = argv[curarg];
- if (ACE_OS::strcasecmp (name,
- ACE_LIB_TEXT("global")) == 0)
- this->use_tss_resources_ = 0;
- else if (ACE_OS::strcasecmp (name,
- ACE_LIB_TEXT("tss")) == 0)
- this->use_tss_resources_ = 1;
- else
- this->report_option_value_error (ACE_LIB_TEXT("-ORBResources"), name);
- }
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) This option has been deprecated \n")));
}
else if (ACE_OS::strcasecmp (argv[curarg],
@@ -542,11 +531,14 @@ TAO_Default_Resource_Factory::init_protocol_factories (void)
return 0;
}
+#if 0
+// @@todo: Need to go at a later date!
int
TAO_Default_Resource_Factory::use_tss_resources (void) const
{
- return this->use_tss_resources_;
+ return 0;
}
+#endif /*if 0*/
int
TAO_Default_Resource_Factory::use_locked_data_blocks (void) const
diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h
index 627b97a0e93..8500447bc79 100644
--- a/TAO/tao/default_resource.h
+++ b/TAO/tao/default_resource.h
@@ -96,7 +96,10 @@ public:
int cdr_allocator_source (void);
// = Resource Retrieval
+#if 0
+ // @@@todo: Need to go at a later date
virtual int use_tss_resources (void) const;
+#endif /*if 0*/
virtual int use_locked_data_blocks (void) const;
virtual ACE_Reactor *get_reactor (void);
virtual void reclaim_reactor (ACE_Reactor *);
@@ -139,10 +142,6 @@ protected:
protected:
- /// Flag indicating whether resources should be global or
- /// thread-specific.
- int use_tss_resources_;
-
/// The type of data blocks that the ORB should use
int use_locked_data_blocks_;