Search code examples
c++boostboost-signalsboost-signals2

Boost.Signals deprecated


Boost.Signals is no longer being actively maintained, so it has been deprecated. Do not use Boost.Signals for new development (use Boost.Signals2 instead). If you have existing Boost.Signals-based code, it will continue to work, but consider moving to Boost.Signals2.

http://www.boost.org/users/history/version_1_54_0.html

So, Signals are deprecated. I'm confused about this. As far as I know, Signals2 is multi-threaded version of Signals. But what if I don't need multi-threading usage of Signals? Will I get some overhead? Can I use boost::signals2::trackable? Will I get any disadvantages using Signals2 in single-thread application?


Solution

  • As far as I know, Signals2 is multi-threaded version of Signals. But what if I don't need multi-threading usage of Signals? Will I get some overhead?

    In a single-threaded environment use dummy_mutex, as described here.

    Can I use boost::signals2::trackable?

    Yes, you can use it, but keep in mind that it won't be thread-safe approach. So if you eventually decide to adjust your module to a mutli-threaded environment, you'll have to re-design your slots.