BDE 4.14.0 Production release
|
Provide utilities to allow configuration of values for BCE.
This component defines a utility struct
, bslmt::Configuration
, that is a name space for pure functions used for providing access to, and configuring, default values for BCE-relevant parameters. The bslmt::Configuration
utility currently provides static methods to access and modify the BCE library's default stack size, as well as functions that access the platform's native default stack size and guard size. The BDE default stack size is initially configured to bslmt::ThreadAttributes::BSLMT_UNSET_STACK_SIZE
, in which case thread creation is to use the native default thread stack size.
This section illustrates intended use of this component.
In this example we demonstrate how to access both the platform's native and BDE configured default stack sizes, and then to set the default stack size used by BDE. Note that the value returned by defaultThreadStackSize
may be adjusted from that provided by the underlying operating system to reflect the actual amount of stack memory available to a created thread. Note that operations creating a thread should perform a similar inverse adjustment when configuring the new thread's stack size (see bslmt_threadutil ).
First, we examine the platform's native thread stack size:
Then, we verify that defaultThreadStackSize
is unset.
Next, we define newDefaultStackSize
to some size other than the platform's native default stack size:
Now, we set the default size for BCE to the new size:
Finally, we verify that BCE's default thread stack size has been set to the value we specified: