diff options
author | wilsond <wilsond@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-08-10 22:02:21 +0000 |
---|---|---|
committer | wilsond <wilsond@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-08-10 22:02:21 +0000 |
commit | 158274990f0a304fd4c597ae0d9c4123228034d9 (patch) | |
tree | 056c2b956e66a0ad7711f49e26b1c3258ee7ca80 | |
parent | 467ffa06ae804f6a4aabc8519d3ccb22fabcc286 (diff) | |
download | ATCD-158274990f0a304fd4c597ae0d9c4123228034d9.tar.gz |
ChangeLogTag: Fri Aug 10 21:59:23 UTC 2007 Dale Wilson <wilsond@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 11 | ||||
-rw-r--r-- | TAO/tao/Transport_Cache_Manager.cpp | 136 | ||||
-rw-r--r-- | TAO/tao/Transport_Cache_Manager.h | 16 |
3 files changed, 65 insertions, 98 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index b49ec54e3d4..c4e27224ad7 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Fri Aug 10 21:59:23 UTC 2007 Dale Wilson <wilsond@ociweb.com> + + * tao/Transport_Cache_Manager.h: + * tao/Transport_Cache_Manager.cpp: + The cache manager uses an index to distinguish between duplicate cache entries. + It makes some invalid assumptions about this index. This changes corrects + one of those assumptions which led to poor performance and/or failure of + multithreaded latency performance tests. + Fri Aug 10 15:33:54 UTC 2007 Chad Elliott <elliott_c@ociweb.com> * docs/notification/monitor.html: @@ -11,7 +20,7 @@ Fri Aug 10 15:33:54 UTC 2007 Chad Elliott <elliott_c@ociweb.com> * orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMC.idl: * orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.cpp: - Modified to throw the InvalidName exception if the name provided + Modified to throw the InvalidName exception if the name provided to shutdown_event_channel does not correspond to an event channel. Fri Aug 10 10:22:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> diff --git a/TAO/tao/Transport_Cache_Manager.cpp b/TAO/tao/Transport_Cache_Manager.cpp index 922e0b184a4..9c0ad989efe 100644 --- a/TAO/tao/Transport_Cache_Manager.cpp +++ b/TAO/tao/Transport_Cache_Manager.cpp @@ -19,11 +19,11 @@ ACE_RCSID (tao, Transport_Cache_Manager, "$Id$") -// notes on debug level for transport cache +// notes on debug level and LM_xxxx codes for transport cache // TAO_debug_level > 0: recoverable error condition (LM_ERROR) // TAO_debug_level > 4: normal transport cache operations (LM_INFO) // TAO_debug_level > 6: detailed cache operations (LM_DEBUG) -// TAO_debug_level > 8: for debugging the cache itself +// TAO_debug_level > 8: for debugging the cache itself (LM_DEBUG) TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -88,71 +88,68 @@ namespace TAO // Update the purging strategy information while we // are holding our lock this->purging_strategy_->update_item (int_id.transport ()); - - int retval = this->cache_map_.bind (ext_id, - int_id, - entry); - if (retval == 0) - { - // The entry has been added to cache succesfully - // Add the cache_map_entry to the transport - int_id.transport ()->cache_map_entry (entry); - } - else if (retval == 1) + int retval = 0; + bool more_to_do = true; + while (more_to_do) { - // if this is already in the cache, just ignore the request - // this happens because some protocols bind their transport early - // to avoid duplication simultaneous connection attempts - if (entry != 0 && entry->item ().transport () == int_id.transport ()) + retval = this->cache_map_.bind (ext_id, int_id, entry); + if (retval == 0) { - // rebind this entry to update cache status - retval = this->cache_map_.rebind (ext_id, - int_id, - entry); - if(retval == 1) // 1 from rebind means replaced + // The entry has been added to cache succesfully + // Add the cache_map_entry to the transport + int_id.transport ()->cache_map_entry (entry); + more_to_do = false; + } + else if (retval == 1) + { + if (entry->item ().transport () == int_id.transport ()) { + // update the cache status + this->set_entry_state (entry, int_id.recycle_state ()); retval = 0; + more_to_do = false; } - } - else - { - if (TAO_debug_level > 4) - { - ACE_DEBUG ((LM_INFO, - ACE_TEXT ("TAO (%P|%t) - Transport_Cache_Manager::bind_i: ") - ACE_TEXT ("Unable to bind in the first attempt. ") - ACE_TEXT ("Trying with a new index\n") - )); - } - - // There was an entry like this before, so let us do some - // minor adjustments and rebind - retval = this->get_last_index_bind (ext_id, - int_id, - entry); - if (retval == 0) + else { - int_id.transport ()->cache_map_entry (entry); + ext_id.index (ext_id.index() + 1); + if (TAO_debug_level > 8) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) - Transport_Cache_Manager::bind_i: ") + ACE_TEXT ("Unable to bind Transport[%d] @ hash:index{%d:%d}. ") + ACE_TEXT ("Trying with a new index \n"), + int_id.transport ()->id (), + ext_id.hash (), + ext_id.index () + )); + } } - } - } - - if (retval != 0) - { - if (TAO_debug_level > 0) + } + else { - ACE_ERROR ((LM_ERROR, - "TAO (%P|%t) - Transport_Cache_Manager::bind_i, " - "unable to bind\n")); + if (TAO_debug_level > 0) + { + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) - Transport_Cache_Manager::bind_i, " + "ERROR: unable to bind transport\n")); + } + more_to_do = false; } } - else if (TAO_debug_level > 4) + if (retval == 0) { - ACE_DEBUG ((LM_INFO, - ACE_TEXT ("TAO (%P|%t) - Transport_Cache_Manager::bind_i: ") - ACE_TEXT ("Cache size is [%d]\n"), - this->current_size () - )); + if (TAO_debug_level > 4) + { + ACE_DEBUG ((LM_INFO, + ACE_TEXT ("TAO (%P|%t) - Transport_Cache_Manager::bind_i: ") + ACE_TEXT ("Success Transport[%d] @ hash:index{%d:%d}. ") + ACE_TEXT ("Cache size is [%d]\n"), + int_id.transport ()->id (), + ext_id.hash (), + ext_id.index (), + this->current_size () + )); + } } return retval; @@ -449,31 +446,6 @@ namespace TAO entry->item ().recycle_state (ENTRY_PURGABLE_BUT_NOT_IDLE); } - int - Transport_Cache_Manager::get_last_index_bind (Cache_ExtId &key, - Cache_IntId &val, - HASH_MAP_ENTRY *&entry) - { - CORBA::ULong ctr = entry->ext_id_.index (); - int retval = 0; - - while (retval == 0) - { - // Set the index - key.index (++ctr); - - // Check to see if an element exists in the Map. If it exists we - // loop, else we drop out of the loop - retval = this->cache_map_.find (key); - } - - // Now do a bind again with the new index - return this->cache_map_.bind (key, - val, - entry); - } - - bool Transport_Cache_Manager::is_entry_available (const HASH_MAP_ENTRY &entry) { @@ -687,7 +659,7 @@ namespace TAO // Do we need to worry about cache purging? if (cache_maximum >= 0) { - current_size = static_cast<int> (this->cache_map_.current_size ()); + current_size = static_cast<int> (this->current_size ()); if (TAO_debug_level > 6) { diff --git a/TAO/tao/Transport_Cache_Manager.h b/TAO/tao/Transport_Cache_Manager.h index 72c9b1fcf44..e95edd40092 100644 --- a/TAO/tao/Transport_Cache_Manager.h +++ b/TAO/tao/Transport_Cache_Manager.h @@ -176,9 +176,7 @@ namespace TAO * Non-Locking version and actual implementation of bind () * call. Calls bind on the Hash_Map_Manager that it holds. If the * bind succeeds, it adds the Hash_Map_Entry in to the - * Transport for its reference. If the bind fails because - * of an exiting entry, this method calls the get_last_index_bind - * (). + * Transport for its reference. */ int bind_i (Cache_ExtId &ext_id, Cache_IntId &int_id); @@ -206,18 +204,6 @@ namespace TAO void mark_invalid_i (HASH_MAP_ENTRY *entry); private: - /** - * This is called by the bind () call when a bind fails with a - * available entry. When a new connection is created in TAO with an - * already existing endpoint, in addition to an exisitng one, we - * mark the connections with an index. This method, finds out the - * last highest index and binds the entry with an index = (last - * highest index + 1). - */ - int get_last_index_bind (Cache_ExtId &key, - Cache_IntId &val, - HASH_MAP_ENTRY *&entry); - /** * Tries to find if the <int_id_> in entry is available for use. */ |