Signals vs Signals2
Asked Answered
I

2

12

I have application that may benefit from using one of boost's signals libraries over a homegrown solution.

The application is multithreaded but the part that does the signal processing is single threaded.

Is there any reason to prefer Boost.Signals2 over Boost.Signal if multithreading is not an issue?

Impartible answered 1/11, 2011 at 16:52 Comment(5)
Make sure you consider libtscb as well -- its performance comparisons are especially noteworthy.Secrest
@ildjarn: unfortunately the libtscb requires GCC. I don't know about the rest of library, but the atomics are only implemented for GCC. Once Visual Studio gets C++11 std::atomic it could be trivially ported.Impartible
Another option is to use the currently-under-review Boost.Atomics :-]Secrest
Also, if you've not already seen it, the Signal2 docs already lists the major changes from Signals, including enhanced or removed functionality not related to thread-safety: Signals2 API ChangesSecrest
Another library to consider might be Sarah Thompson's Sigslots: sigslot.sourceforge.netUnbated
K
10

Boost.Signals is now deprecated, and Boost.Signals2 should be used instead (see v1.54 docs)

Kingfisher answered 23/8, 2013 at 22:34 Comment(2)
To quote an important note on that page (for convenience): "Boost.Signals is no longer being actively maintained. 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. There is a porting guide in the Signals2 documentation."Benn
And to be honest, most of the times, when you start using a nice feature, you'll end up wanting to use it at some other places than where it was first desired.Tiltyard
L
5

Originally, if all the signals and slots were in the same thread, boost.signals was just fine. However, it is no longer being maintained -- the documentation suggests using signals2 in all new code.

Landel answered 1/11, 2011 at 18:17 Comment(1)
signals2 has other changes over signal, so it should be considered anywayShipentine

© 2022 - 2024 — McMap. All rights reserved.