Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

bslmt::Configuration Struct Reference

#include <bslmt_configuration.h>

List of all members.

Static Public Member Functions

static int defaultThreadStackSize ()
static int nativeDefaultThreadStackSize ()
static int nativeDefaultThreadGuardSize ()
static int recommendedDefaultThreadStackSize ()
static void setDefaultThreadStackSize (int numBytes)

Detailed Description

This struct provides a namespace for a suite of functions that are used to manage the configuration of default values used in bslmt. Specifically, these functions manage the default value of thread stack size and provide access to the platform's native guard size, but may be extended to govern more traits in the future.

See Component bslmt_configuration


Member Function Documentation

static int bslmt::Configuration::defaultThreadStackSize (  )  [static]

Return the value set by the last call to setDefaultThreadStackSize; if setDefaultThreadStackSize has never been called, return ThreadAttributes::BSLMT_UNSET_STACK_SIZE which will signal thread creation to use the thread stack size native to the platform.

static int bslmt::Configuration::nativeDefaultThreadStackSize (  )  [static]

Return the "native" default thread stack size (in bytes) as determined by the underlying platform. Note that this value may be influenced by the choice of platform, environment variables, compiler/linker options, or shell configuration, and typically varies wildly among different platforms.

static int bslmt::Configuration::nativeDefaultThreadGuardSize (  )  [static]

Return the default thread stack guard size (in bytes) determined by the underlying platform. Note that this value reflects semantics, and may be influenced by the choice of platform, environment variables, compiler/linker options, or shell configuration, and may vary somewhat among different platforms.

static int bslmt::Configuration::recommendedDefaultThreadStackSize (  )  [static]

Return a "reasonable" value for the default thread stack size (in bytes), which, unlike nativeDefaultThreadStackSize, is constant across all platforms of a given word size. This value is large enough to guarantee that an automatic array of at least 250 * 1024 pointers may be declared in the top level routine of the thread.

static void bslmt::Configuration::setDefaultThreadStackSize ( int  numBytes  )  [static]

Set the default thread stack size to the specified numBytes. If a minimum thread stack size is known for the underlying platform (i.e. PTHREAD_STACK_MIN is defined) and numBytes is below that minimum, the stack size will be that minimum. The behavior is undefined unless 0 <= numBytes.


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