Commit 86a13ee9 authored by Philip Pronin's avatar Philip Pronin Committed by Facebook Github Bot

add temporary --dynamic_iothreadpoolexecutor

Summary:
Similar to `--dynamic_cputhreadpoolexecutor`, this is a temporary
kill switch until all outstanding issues are addressed that would allow us
to use dynamic thread pools unconditionally.

Reviewed By: djwatson

Differential Revision: D10231230

fbshipit-source-id: b0abd77ff2a6a7ce31727e14eca799a6f3b5535a
parent db4d4f29
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
*/ */
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/executors/CPUThreadPoolExecutor.h>
#include <folly/executors/task_queue/PriorityLifoSemMPMCQueue.h> #include <folly/executors/task_queue/PriorityLifoSemMPMCQueue.h>
#include <folly/portability/GFlags.h>
DEFINE_bool( DEFINE_bool(
dynamic_cputhreadpoolexecutor, dynamic_cputhreadpoolexecutor,
......
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/detail/MemoryIdler.h> #include <folly/detail/MemoryIdler.h>
#include <folly/portability/GFlags.h>
DEFINE_bool(
dynamic_iothreadpoolexecutor,
true,
"IOThreadPoolExecutor will dynamically create threads");
namespace folly { namespace folly {
...@@ -66,7 +72,11 @@ IOThreadPoolExecutor::IOThreadPoolExecutor( ...@@ -66,7 +72,11 @@ IOThreadPoolExecutor::IOThreadPoolExecutor(
std::shared_ptr<ThreadFactory> threadFactory, std::shared_ptr<ThreadFactory> threadFactory,
EventBaseManager* ebm, EventBaseManager* ebm,
bool waitForAll) bool waitForAll)
: ThreadPoolExecutor(numThreads, 0, std::move(threadFactory), waitForAll), : ThreadPoolExecutor(
numThreads,
FLAGS_dynamic_iothreadpoolexecutor ? 0 : numThreads,
std::move(threadFactory),
waitForAll),
nextThread_(0), nextThread_(0),
eventBaseManager_(ebm) { eventBaseManager_(ebm) {
setNumThreads(numThreads); setNumThreads(numThreads);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment