Boost logo

Boost :

Subject: Re: [boost] [Log] Running in a separate thread
From: Andrew Hundt (athundt_at_[hidden])
Date: 2015-07-29 12:48:15

On Wed, Jul 1, 2015 at 5:41 PM, Andrey Semashev <andrey.semashev_at_[hidden]>

> On 02.07.2015 00:16, Andrew Hundt wrote:
>> Is there a straightforward non-intrusive solution to having as much of the
>> work as possible for boost.log be done in a separate thread?
> Boost.Log does support asynchronous logging[1] although the current
> implementation might not suit well for realtime use either. It does have a
> lock in the internal record queue which is used to pass log records from
> the application threads to the log processing thread, although the critical
> section is minimal.
> In order to enable async logging you have to configure the library by
> adding asynchronous sinks and probably some attributes on your application
> startup. You can keep using BOOST_LOG_TRIVIAL for emitting log records, the
> only change needed is the initial configuration.
> [1]
Thanks for the feedback, that looks like it could be the right way to go
about it!

However, I'm a bit unlucky because my application is implemented as
dynamically loaded modules attached to another application, which there is
a large warning about in your link. Do you know of any additional more
detailed information about how best to ensure the data lifetimes are
managed correctly so async sinks don't crash when modules are loaded or

Andrew Hundt

Boost list run by bdawes at, gregod at, cpdaniel at, john at