diff options
author | Bernard Normier <bernard@zeroc.com> | 2004-10-22 13:38:33 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2004-10-22 13:38:33 +0000 |
commit | d935ac76e304956f168a2f2b2907ef93e5e258ca (patch) | |
tree | ea095a95b5d464a39470622d036450a906588e70 /cpp/src/Ice/ThreadPool.cpp | |
parent | Glacier2 thread stack size properties (diff) | |
download | ice-d935ac76e304956f168a2f2b2907ef93e5e258ca.tar.bz2 ice-d935ac76e304956f168a2f2b2907ef93e5e258ca.tar.xz ice-d935ac76e304956f168a2f2b2907ef93e5e258ca.zip |
Stack size for Ice thread pools
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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<int&>(_sizeMax) = sizeMax; const_cast<int&>(_sizeWarn) = sizeWarn; + int stackSize = _instance->properties()->getPropertyAsIntWithDefault(_prefix + ".StackSize", 0); + if(stackSize < 0) + { + stackSize = 0; + } + const_cast<size_t&>(_stackSize) = static_cast<size_t>(stackSize); + const_cast<int&>(_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) |