The parallel_group and make_parallel_group implementations satisfy the
asynchronous operation requirements by delegating to the supplied
operations. It is not possible for them to do this when the supplied set
is empty.
Add a new configuration option "reactor" / "use_eventfd" that is used by
the epoll_reactor. When true (the default), the reactor uses an eventfd
as its select_interrupter implementation. When false, a pipe is used
instead.
Add a new configuration option "reactor" / "use_timerfd" that is used by
the epoll_reactor. When true (the default), the reactor uses a timerfd
descriptor to manage timeouts. When false, the duration until the next
timeout is computed and passed as a timeout to epoll_wait.
Add a new configuration option "reactor" / "reset_edge_on_partial_read"
that is used by the epoll_reactor. When true, it indicates that a partial
read should be considered to have consumed the edge. The default value of
false corresponds to the existing behaviour, where the edge is only
treated as consumed when the read fails with EAGAIN.
The number of threads used to emulate asynchronous address resolution is
now adjustable via the "resolver" / "threads" configuration option. If
this is set to a non-zero value, that number of threads will be created
when the first resolver object is constructed. Otherwise, it defaults to
a single thread that is created on the first call to async_resolve.
The asio::config class provides access to configuration variables that
are associated with an execution context. The class is intended for use
by asio internals, or by libraries or user-provided abstractions that
build on top of asio. These configuration variables will typically be
used to fine tune behaviour, such as enabling or disabling certain
optimisations.
When constructing an execution context, such as an io_context, the
caller may optionally pass a service_maker to install a concrete
configuration service into the context. For example:
asio::io_context ctx{asio::config_from_env{}};
The configuration variables' values are accessed by using the
asio::config class, passing a section, key and default value:
asio::config cfg{ctx};
bool enable_locking = cfg.get("scheduler", "locking", true);
The initial set of configuration variables recognised by the asio
internals correspond to the concurrency hint and its special values:
"scheduler" / "concurrency_hint" (int)
"scheduler" / "locking" (bool)
"reactor" / "registration_locking" (bool)
"reactor" / "io_locking" (bool)
A service_maker is an object that is passed to an execution context's
constructor, and allows services to be added at context construction
time. Additional constructor overloads have been added to io_context and
thread_pool that accept a service_maker. For example:
class my_service_maker : public execution_context::service_maker
{
public:
void make(execution_context& ctx) override
{
make_service<my_service>(ctx);
}
};
io_context ctx{my_service_maker{}};