summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/IceGridNode.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2010-02-19 18:45:14 +0100
committerBenoit Foucher <benoit@zeroc.com>2010-02-19 18:45:14 +0100
commitea9a8bcfc079175205766491ab217e65536a656f (patch)
tree8dd6cd069f9966bd59d72587052a42195d45cf63 /cpp/src/IceGrid/IceGridNode.cpp
parentadded txt to ICE_LICENSE (diff)
downloadice-ea9a8bcfc079175205766491ab217e65536a656f.tar.bz2
ice-ea9a8bcfc079175205766491ab217e65536a656f.tar.xz
ice-ea9a8bcfc079175205766491ab217e65536a656f.zip
Fixed bug 4677 - IceGrid update hang
Diffstat (limited to 'cpp/src/IceGrid/IceGridNode.cpp')
-rw-r--r--cpp/src/IceGrid/IceGridNode.cpp48
1 files changed, 7 insertions, 41 deletions
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp
index 4b435ef4d62..ebb75307ba6 100644
--- a/cpp/src/IceGrid/IceGridNode.cpp
+++ b/cpp/src/IceGrid/IceGridNode.cpp
@@ -22,6 +22,7 @@
#include <IceGrid/NodeSessionManager.h>
#include <IceGrid/TraceLevels.h>
#include <IceGrid/DescriptorParser.h>
+#include <IceGrid/Util.h>
#include <IcePatch2/Util.h>
#ifdef _WIN32
@@ -293,47 +294,7 @@ NodeService::startImpl(int argc, char* argv[], int& status)
out << "you should set individual adapter thread pools instead.";
}
- int size = properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.Size", 0);
- if(size <= 0)
- {
- properties->setProperty("IceGrid.Node.ThreadPool.Size", "1");
- size = 1;
- }
-
- int sizeMax = properties->getPropertyAsIntWithDefault("IceGrid.Node.ThreadPool.SizeMax", 0);
- if(sizeMax <= 0)
- {
- if(size >= sizeMax)
- {
- sizeMax = size * 10;
- }
-
- ostringstream os;
- os << sizeMax;
- properties->setProperty("IceGrid.Node.ThreadPool.SizeMax", os.str());
- }
-
- size = properties->getPropertyAsIntWithDefault("Ice.ThreadPool.Client.Size", 0);
- if(size <= 0)
- {
- properties->setProperty("Ice.ThreadPool.Client.Size", "1");
- size = 1;
- }
- sizeMax = properties->getPropertyAsIntWithDefault("Ice.ThreadPool.Client.SizeMax", 0);
- if(sizeMax <= 0)
- {
- if(size >= sizeMax)
- {
- sizeMax = size * 10;
- }
- if(sizeMax < 100)
- {
- sizeMax = 100;
- }
- ostringstream os;
- os << sizeMax;
- properties->setProperty("Ice.ThreadPool.Client.SizeMax", os.str());
- }
+ setupThreadPool(properties, "IceGrid.Node.ThreadPool", 1, 100);
//
// Create the activator.
@@ -838,6 +799,11 @@ NodeService::initializeCommunicator(int& argc, char* argv[],
initData.properties->setProperty("Ice.Plugin.DB", "IceGridFreezeDB:createFreezeDB");
}
+ //
+ // Setup the client thread pool size.
+ //
+ setupThreadPool(initData.properties, "Ice.ThreadPool.Client", 1, 100);
+
return Service::initializeCommunicator(argc, argv, initData);
}