diff options
author | Marc Laukien <marc@zeroc.com> | 2006-08-15 18:11:38 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2006-08-15 18:11:38 +0000 |
commit | d3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13 (patch) | |
tree | df7c79f1e34a583e555d3c8a5e9efae10374d1ed /cpp/src/Ice/Instance.cpp | |
parent | fixing ref-count bug for Communicator wrapper (diff) | |
download | ice-d3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13.tar.bz2 ice-d3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13.tar.xz ice-d3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13.zip |
started the 'two threads per connection'
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 031d3a723bd..d72faa0b850 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -232,7 +232,7 @@ IceInternal::Instance::serverThreadPool() return _serverThreadPool; } -bool +int IceInternal::Instance::threadPerConnection() const { // No mutex lock, immutable. @@ -457,7 +457,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi _messageSizeMax(0), _clientACM(0), _serverACM(0), - _threadPerConnection(false), + _threadPerConnection(0), _threadPerConnectionStackSize(0), _defaultContext(new SharedContext(initData.defaultContext)) { @@ -629,7 +629,18 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi const_cast<Int&>(_clientACM) = _initData.properties->getPropertyAsIntWithDefault("Ice.ACM.Client", 60); const_cast<Int&>(_serverACM) = _initData.properties->getPropertyAsInt("Ice.ACM.Server"); - const_cast<bool&>(_threadPerConnection) = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection") > 0; + { + Int threadPerConnection = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection"); + if(threadPerConnection < 0) + { + threadPerConnection = 0; + } + if(threadPerConnection > 2) + { + threadPerConnection = 2; + } + const_cast<Int&>(_threadPerConnection) = threadPerConnection; + } { Int stackSize = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection.StackSize"); |