Large number of simulteneous connections in thrift

后端 未结 2 1815
走了就别回头了
走了就别回头了 2021-01-03 02:21

I\'m trying to write a simple server with Thrift. At the beginning it looked promising, but I\'ve stumbled into a problem with a number of clients connected at the same time

2条回答
  •  独厮守ぢ
    2021-01-03 03:24

    Your limitation of four threads in the pool is built into the default constructor of the SimpleThreadManager:

    class SimpleThreadManager : public ThreadManager::Impl {
    
     public:
      SimpleThreadManager(size_t workerCount=4, size_t pendingTaskCountMax=0) :
        workerCount_(workerCount),
        pendingTaskCountMax_(pendingTaskCountMax),
        firstTime_(true) {
      }
    ...
    };
    

    This ThreadManager object is passed to the ThreadPoolServer coonstructor, so pass a larger number to the constructor of this object to increase the size of your thread pool.

提交回复
热议问题