Skip to content

Commit

Permalink
Drop folly_global_cpu_executor_use_throttled_lifo_sem flag
Browse files Browse the repository at this point in the history
Summary: Now that `CPUThreadPoolExecutor` uses `ThrottledLifoSem` by default, there is no reason anymore to have a custom override for the global executor, it should just follow the global default behavior of `CPUThreadPoolExecutor`, so we can remove the flags.

Reviewed By: yfeldblum

Differential Revision: D65945195

fbshipit-source-id: 43aba489937aa8891c23dd028b6dce6536c41ad9
  • Loading branch information
ot authored and facebook-github-bot committed Nov 15, 2024
1 parent 479de01 commit 49d9206
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions folly/executors/GlobalExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ FOLLY_GFLAGS_DEFINE_uint32(
0,
"Number of threads global CPUThreadPoolExecutor will create");

FOLLY_GFLAGS_DEFINE_bool(
folly_global_cpu_executor_use_throttled_lifo_sem,
true,
"Use ThrottledLifoSem in global CPUThreadPoolExecutor");

FOLLY_GFLAGS_DEFINE_uint32(
folly_global_cpu_executor_wake_up_interval_us,
0,
"If --folly_global_cpu_executor_use_throttled_lifo_sem is true, use this "
"wake-up interval (in microseconds) in ThrottledLifoSem");

namespace {

using ImmutableGlobalCPUExecutor = CPUThreadPoolExecutor;
Expand All @@ -71,15 +60,10 @@ Singleton<std::shared_ptr<ImmutableGlobalCPUExecutor>, GlobalTag>
gImmutableGlobalCPUExecutor([] {
size_t nthreads = FLAGS_folly_global_cpu_executor_threads;
nthreads = nthreads ? nthreads : folly::hardware_concurrency();
return new std::shared_ptr<
ImmutableGlobalCPUExecutor>(new ImmutableGlobalCPUExecutor(
nthreads,
FLAGS_folly_global_cpu_executor_use_throttled_lifo_sem
? CPUThreadPoolExecutor::makeThrottledLifoSemQueue(
std::chrono::microseconds{
FLAGS_folly_global_cpu_executor_wake_up_interval_us})
: CPUThreadPoolExecutor::makeLifoSemQueue(),
std::make_shared<NamedThreadFactory>("GlobalCPUThreadPool")));
return new std::shared_ptr<ImmutableGlobalCPUExecutor>(
new ImmutableGlobalCPUExecutor(
nthreads,
std::make_shared<NamedThreadFactory>("GlobalCPUThreadPool")));
});

Singleton<std::shared_ptr<IOThreadPoolExecutor>, GlobalTag>
Expand Down

0 comments on commit 49d9206

Please sign in to comment.