diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-03-06 10:13:42 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-03-06 10:13:42 +0100 |
commit | c6dbd090d9691cc0116a2967b2827b858b184dfe (patch) | |
tree | 6d2ad80c98665c9090b16f97c400ab4b33c7ab73 /cpp/src/Ice/ThreadPool.h | |
parent | Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff) | |
download | ice-c6dbd090d9691cc0116a2967b2827b858b184dfe.tar.bz2 ice-c6dbd090d9691cc0116a2967b2827b858b184dfe.tar.xz ice-c6dbd090d9691cc0116a2967b2827b858b184dfe.zip |
Removed thread-per-connection and added serialize mode
Diffstat (limited to 'cpp/src/Ice/ThreadPool.h')
-rw-r--r-- | cpp/src/Ice/ThreadPool.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cpp/src/Ice/ThreadPool.h b/cpp/src/Ice/ThreadPool.h index a8002a958f3..8d2af981337 100644 --- a/cpp/src/Ice/ThreadPool.h +++ b/cpp/src/Ice/ThreadPool.h @@ -41,10 +41,12 @@ public: void incFdsInUse(); void decFdsInUse(); - void _register(SOCKET, const EventHandlerPtr&); - void unregister(SOCKET); + void _register(const EventHandlerPtr&); + void unregister(const EventHandlerPtr&); + void finish(const EventHandlerPtr&); void execute(const ThreadPoolWorkItemPtr&); - void promoteFollower(); + + void promoteFollower(EventHandler* = 0); void joinWithAllThreads(); std::string prefix() const; @@ -58,11 +60,10 @@ private: bool _destroyed; const std::string _prefix; - Selector _selector; + Selector<EventHandler> _selector; - std::list<std::pair<SOCKET, EventHandlerPtr> > _changes; // Event handler set for addition; null for removal. std::list<ThreadPoolWorkItemPtr> _workItems; - std::map<SOCKET, EventHandlerPtr> _handlerMap; + std::list<EventHandlerPtr> _finished; class EventHandlerThread : public IceUtil::Thread { @@ -80,7 +81,8 @@ private: const int _size; // Number of threads that are pre-created. const int _sizeMax; // Maximum number of threads. const int _sizeWarn; // If _inUse reaches _sizeWarn, a "low on threads" warning will be printed. - + const bool _serialize; // True if requests need to be serialized over the connection. + const size_t _stackSize; std::vector<IceUtil::ThreadPtr> _threads; // All threads, running or not. |