summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a14
-rw-r--r--TAO/tao/Sync_Strategies.cpp7
-rw-r--r--TAO/tao/Sync_Strategies.h3
-rw-r--r--TAO/tao/Transport.cpp39
-rw-r--r--TAO/tao/Transport.h2
5 files changed, 50 insertions, 15 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index a95e7a9e5b0..891d219d886 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,17 @@
+Thu Apr 12 20:15:22 2001 Carlos O'Ryan <coryan@uci.edu>
+
+ * tao/Sync_Strategies.h:
+ * tao/Sync_Strategies.cpp:
+ Use two separate flags to return if:
+ (1) the queue should be immediately flushed
+ (2) and/or the ORB should start draining the queue
+
+ * tao/Transport.h:
+ * tao/Transport.cpp:
+ Use the new interface in TAO_Sync_Strategy to correctly
+ implement TAO::BUFFER_MESSAGE_COUNT and the TAO::BUFFER_SIZE
+ buffering constraint policies.
+
Wed Apr 11 10:21:35 2001 Carlos O'Ryan <coryan@uci.edu>
* With the following changes the semantics of oneways are
diff --git a/TAO/tao/Sync_Strategies.cpp b/TAO/tao/Sync_Strategies.cpp
index b74e06bc096..60d902e9de1 100644
--- a/TAO/tao/Sync_Strategies.cpp
+++ b/TAO/tao/Sync_Strategies.cpp
@@ -31,6 +31,7 @@ TAO_Transport_Sync_Strategy::
size_t ,
size_t ,
int &,
+ int &,
ACE_Time_Value &)
{
return 0;
@@ -52,6 +53,7 @@ TAO_Eager_Buffering_Sync_Strategy::
buffering_constraints_reached (TAO_Stub *stub,
size_t msg_count,
size_t total_bytes,
+ int &must_flush,
int &set_timer,
ACE_Time_Value &interval)
{
@@ -70,7 +72,10 @@ TAO_Eager_Buffering_Sync_Strategy::
this->timer_check (buffering_constraint, set_timer, interval);
if (buffering_constraint.mode == TAO::BUFFER_FLUSH)
- return 1;
+ {
+ must_flush = 1;
+ return 1;
+ }
if (ACE_BIT_ENABLED (buffering_constraint.mode,
TAO::BUFFER_MESSAGE_COUNT)
diff --git a/TAO/tao/Sync_Strategies.h b/TAO/tao/Sync_Strategies.h
index b5f2ae4b2ee..d04bad05eeb 100644
--- a/TAO/tao/Sync_Strategies.h
+++ b/TAO/tao/Sync_Strategies.h
@@ -64,6 +64,7 @@ public:
virtual int buffering_constraints_reached (TAO_Stub *stub,
size_t msg_count,
size_t total_bytes,
+ int &must_flush,
int &set_timer,
ACE_Time_Value &interval) = 0;
};
@@ -76,6 +77,7 @@ public:
virtual int buffering_constraints_reached (TAO_Stub *stub,
size_t msg_count,
size_t total_bytes,
+ int &must_flush,
int &set_timer,
ACE_Time_Value &interval);
};
@@ -90,6 +92,7 @@ public:
virtual int buffering_constraints_reached (TAO_Stub *stub,
size_t msg_count,
size_t total_bytes,
+ int &must_flush,
int &set_timer,
ACE_Time_Value &interval);
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index a5ed9ddd8c1..9819664e789 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -323,7 +323,6 @@ TAO_Transport::send_message_i (TAO_Stub *stub,
TAO_Flushing_Strategy *flushing_strategy =
this->orb_core ()->flushing_strategy ();
- int start_flushing = 1;
if (try_sending_first)
{
// ... in this case we must try to send the message first ...
@@ -368,9 +367,11 @@ TAO_Transport::send_message_i (TAO_Stub *stub,
// be fast.
return 0;
}
- }
- (void) flushing_strategy->schedule_output (this);
+ // ... if the message was partially sent then we need to
+ // continue sending ASAP ...
+ (void) flushing_strategy->schedule_output (this);
+ }
// ... either the message must be queued or we need to queue it
// because it was not completely sent out ...
@@ -392,7 +393,17 @@ TAO_Transport::send_message_i (TAO_Stub *stub,
// ... if the queue is full we need to activate the output on the
// queue ...
- if (start_flushing || this->must_flush_queue_i (stub))
+ int must_flush = 0;
+ int constraints_reached =
+ this->check_buffering_constraints_i (stub,
+ must_flush);
+
+ if (constraints_reached)
+ {
+ (void) flushing_strategy->schedule_output (this);
+ }
+
+ if (must_flush)
{
typedef ACE_Reverse_Lock<TAO_SYNCH_MUTEX> TAO_REVERSE_SYNCH_MUTEX;
TAO_REVERSE_SYNCH_MUTEX reverse (this->queue_mutex_);
@@ -880,7 +891,8 @@ TAO_Transport::cleanup_queue (size_t byte_count)
}
int
-TAO_Transport::must_flush_queue_i (TAO_Stub *stub)
+TAO_Transport::check_buffering_constraints_i (TAO_Stub *stub,
+ int &must_flush)
{
// First let's compute the size of the queue:
size_t msg_count = 0;
@@ -894,14 +906,15 @@ TAO_Transport::must_flush_queue_i (TAO_Stub *stub)
int set_timer;
ACE_Time_Value interval;
- if (stub->sync_strategy ().buffering_constraints_reached (stub,
- msg_count,
- total_bytes,
- set_timer,
- interval))
- {
- return 1;
- }
+ int constraints_reached =
+ stub->sync_strategy ().buffering_constraints_reached (stub,
+ msg_count,
+ total_bytes,
+ must_flush,
+ set_timer,
+ interval);
+ if (constraints_reached != 0)
+ return constraints_reached;
// ... it is not time to flush yet, but maybe we need to set a
// timer ...
diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h
index a3141b0e9ca..a275adebdf9 100644
--- a/TAO/tao/Transport.h
+++ b/TAO/tao/Transport.h
@@ -660,7 +660,7 @@ private:
/// TAO_Queued_Message *copy_message_block (const ACE_Message_Block *mb);
/// Check if the buffering constraints have been reached
- int must_flush_queue_i (TAO_Stub *stub);
+ int check_buffering_constraints_i (TAO_Stub *stub, int &must_flush);
/// Send a synchronous message, i.e. block until the message is on
/// the wire