Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
pool_params::thread_safe

Enables or disables thread-safety.

Synopsis
bool thread_safe {false};
Description

When set to true, the resulting connection pool are able to be shared between threads at the cost of some performance.

Enabling thread safety for a pool creates an internal asio::strand object wrapping the executor passed to the pool's constructor. All state-mutating functions (including connection_pool::async_run, connection_pool::async_get_connection and returning connections) will be run through the created strand.

Thread-safety doesn't extend to individual connections: pooled_connection objects can't be shared between threads.


PrevUpHomeNext