From d935ac76e304956f168a2f2b2907ef93e5e258ca Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Fri, 22 Oct 2004 13:38:33 +0000 Subject: Stack size for Ice thread pools --- cpp/src/Ice/ThreadPool.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'cpp/src/Ice/ThreadPool.cpp') diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 04950ac8349..a4bd00614d4 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -34,6 +34,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p _size(0), _sizeMax(0), _sizeWarn(0), + _stackSize(0), _messageSizeMax(0), _running(0), _inUse(0), @@ -75,6 +76,13 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p const_cast(_sizeMax) = sizeMax; const_cast(_sizeWarn) = sizeWarn; + int stackSize = _instance->properties()->getPropertyAsIntWithDefault(_prefix + ".StackSize", 0); + if(stackSize < 0) + { + stackSize = 0; + } + const_cast(_stackSize) = static_cast(stackSize); + const_cast(_messageSizeMax) = instance->messageSizeMax(); __setNoDelete(true); @@ -83,7 +91,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p for(int i = 0 ; i < _size ; ++i) { IceUtil::ThreadPtr thread = new EventHandlerThread(this); - _threads.push_back(thread->start()); + _threads.push_back(thread->start(_stackSize)); ++_running; } } @@ -190,7 +198,7 @@ IceInternal::ThreadPool::promoteFollower() try { IceUtil::ThreadPtr thread = new EventHandlerThread(this); - _threads.push_back(thread->start()); + _threads.push_back(thread->start(_stackSize)); ++_running; } catch(const IceUtil::Exception& ex) -- cgit v1.2.3