diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-21 02:53:59 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-21 02:53:59 +0000 |
commit | 97bbd33afc77e8333e7cdcd747a354f93773741d (patch) | |
tree | 3150e3d5153477713186c347e7f665b49de9a014 /TAO/tao | |
parent | 3827bc039a7a120e9d394d08e468565cbb9bf490 (diff) | |
download | ATCD-97bbd33afc77e8333e7cdcd747a354f93773741d.tar.gz |
Fri Apr 20 21:29:38 2001 Nanbor Wang <nanbor@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Client_Strategy_Factory.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Client_Strategy_Factory.h | 3 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Acceptor.cpp | 3 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Connector.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/default_client.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/default_client.h | 7 |
6 files changed, 36 insertions, 7 deletions
diff --git a/TAO/tao/Client_Strategy_Factory.cpp b/TAO/tao/Client_Strategy_Factory.cpp index 032cfcaca8e..aa28147dd9a 100644 --- a/TAO/tao/Client_Strategy_Factory.cpp +++ b/TAO/tao/Client_Strategy_Factory.cpp @@ -30,6 +30,12 @@ TAO_Client_Strategy_Factory::create_wait_strategy (TAO_Transport *) return 0; } +int +TAO_Client_Strategy_Factory::allow_callback (void) +{ + return 0; +} + ACE_Lock * TAO_Client_Strategy_Factory::create_ft_service_retention_id_lock (void) { diff --git a/TAO/tao/Client_Strategy_Factory.h b/TAO/tao/Client_Strategy_Factory.h index 735e48afa26..72916e7d42f 100644 --- a/TAO/tao/Client_Strategy_Factory.h +++ b/TAO/tao/Client_Strategy_Factory.h @@ -58,6 +58,9 @@ public: /// Create the correct client <wait_for_reply> strategy. virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); + /// Does the client allow any form of callback? + virtual int allow_callback (void); + /// Create a lock to be used by the TAO_Fault_Tolerant_Service class /// to generate unique retention ids virtual ACE_Lock *create_ft_service_retention_id_lock (void); diff --git a/TAO/tao/Strategies/SHMIOP_Acceptor.cpp b/TAO/tao/Strategies/SHMIOP_Acceptor.cpp index 650b9b8c149..f0d63b028f1 100644 --- a/TAO/tao/Strategies/SHMIOP_Acceptor.cpp +++ b/TAO/tao/Strategies/SHMIOP_Acceptor.cpp @@ -299,6 +299,9 @@ TAO_SHMIOP_Acceptor::open_i (TAO_ORB_Core* orb_core) this->base_acceptor_.acceptor().malloc_options ().minimum_bytes_ = this->mmap_size_; + if (orb_core->server_factory ()->activate_server_connections () != 0) + this->base_acceptor_.acceptor().preferred_strategy (ACE_MEM_IO::MT); + // @@ Should this be a catastrophic error??? if (this->base_acceptor_.acceptor ().get_local_addr (this->address_) != 0) { diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp index 3ea9b90662a..eec5c62dcae 100644 --- a/TAO/tao/Strategies/SHMIOP_Connector.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp @@ -91,10 +91,20 @@ TAO_SHMIOP_Connector::open (TAO_ORB_Core *orb_core) TAO_SHMIOP_CONNECT_CONCURRENCY_STRATEGY (orb_core), -1); - return this->base_connector_.open (this->orb_core ()->reactor (), - connect_creation_strategy, - &this->connect_strategy_, - concurrency_strategy); + if (this->base_connector_.open (this->orb_core ()->reactor (), + connect_creation_strategy, + &this->connect_strategy_, + concurrency_strategy) == -1) + return -1; + // We can take advantage of the multithreaded shared-memory transport + // if the client will block on read (i.e., will not allow callback.) + else if (orb_core->client_factory ()->allow_callback () == 0) + + { + this->base_connector_.connector ().preferred_strategy (ACE_MEM_IO::MT); + this->connect_strategy_.connector ().preferred_strategy (ACE_MEM_IO::MT); + } + return 0; } int diff --git a/TAO/tao/default_client.cpp b/TAO/tao/default_client.cpp index a74f2521c72..4f18da08b86 100644 --- a/TAO/tao/default_client.cpp +++ b/TAO/tao/default_client.cpp @@ -195,6 +195,12 @@ TAO_Default_Client_Strategy_Factory::create_wait_strategy (TAO_Transport *transp return ws; } +int +TAO_Default_Client_Strategy_Factory::allow_callback (void) +{ + return (this->wait_strategy_ != TAO_WAIT_ON_READ); +} + ACE_Lock * TAO_Default_Client_Strategy_Factory::create_ft_service_retention_id_lock (void) { diff --git a/TAO/tao/default_client.h b/TAO/tao/default_client.h index c67562af488..266a5c6310e 100644 --- a/TAO/tao/default_client.h +++ b/TAO/tao/default_client.h @@ -50,9 +50,10 @@ public: // = Check Client_Strategy_Factory.h for the documentation of the // following methods. - ACE_Lock* create_profile_lock (void); - TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); - TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); + virtual ACE_Lock* create_profile_lock (void); + virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); + virtual int allow_callback (void); + virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); virtual ACE_Lock *create_ft_service_retention_id_lock (void); private: |