proxygen
folly::fibers::FiberManager::Options Struct Reference

#include <FiberManagerInternal.h>

Public Member Functions

constexpr Options ()
 

Public Attributes

size_t stackSize {kDefaultStackSize}
 
size_t stackSizeMultiplier {kIsSanitize ? 16 : 1}
 
size_t recordStackEvery {0}
 
size_t maxFibersPoolSize {1000}
 
bool useGuardPages {true}
 
uint32_t fibersPoolResizePeriodMs {0}
 

Static Public Attributes

static constexpr size_t kDefaultStackSize {16 * 1024}
 

Detailed Description

Definition at line 79 of file FiberManagerInternal.h.

Constructor & Destructor Documentation

constexpr folly::fibers::FiberManager::Options::Options ( )
inline

Definition at line 125 of file FiberManagerInternal.h.

125 {}

Member Data Documentation

uint32_t folly::fibers::FiberManager::Options::fibersPoolResizePeriodMs {0}

Free unnecessary fibers in the fibers pool every fibersPoolResizePeriodMs milliseconds. If value is 0, periodic resizing of the fibers pool is disabled.

Definition at line 123 of file FiberManagerInternal.h.

Referenced by folly::fibers::FiberManager::getFiber(), folly::fibers::FiberManager::runReadyFiber(), and TEST().

constexpr size_t folly::fibers::FiberManager::Options::kDefaultStackSize {16 * 1024}
static

Definition at line 80 of file FiberManagerInternal.h.

size_t folly::fibers::FiberManager::Options::maxFibersPoolSize {1000}

Keep at most this many free fibers in the pool. This way the total number of fibers in the system is always bounded by the number of active fibers + maxFibersPoolSize.

Definition at line 111 of file FiberManagerInternal.h.

Referenced by BENCHMARK(), folly::fibers::FiberManager::doFibersPoolResizing(), folly::fibers::FiberManager::runReadyFiber(), and TEST().

size_t folly::fibers::FiberManager::Options::recordStackEvery {0}

Record exact amount of stack used.

This is fairly expensive: we fill each newly allocated stack with some known value and find the boundary of unused stack with linear search every time we surrender the stack back to fibersPool. 0 disables stack recording.

Definition at line 104 of file FiberManagerInternal.h.

Referenced by folly::fibers::FiberManager::getFiber(), and TEST().

size_t folly::fibers::FiberManager::Options::stackSize {kDefaultStackSize}

Maximum stack size for fibers which will be used for executing all the tasks.

Definition at line 86 of file FiberManagerInternal.h.

Referenced by folly::fibers::Fiber::fiberFunc().

size_t folly::fibers::FiberManager::Options::stackSizeMultiplier {kIsSanitize ? 16 : 1}

Sanitizers need a lot of extra stack space. 16x is a conservative estimate, but 8x also worked with tests where it mattered. Note that over-allocating here does not necessarily increase RSS, since unused memory is pretty much free.

Definition at line 94 of file FiberManagerInternal.h.

bool folly::fibers::FiberManager::Options::useGuardPages {true}

Protect limited amount of fiber stacks with guard pages.

Definition at line 116 of file FiberManagerInternal.h.


The documentation for this struct was generated from the following file: