Boost logo

Boost :

Subject: Re: [boost] first steps to submitting - boost :: observers
From: Bjorn Reese (breese_at_[hidden])
Date: 2016-09-18 06:49:37


On 09/17/2016 08:10 PM, Robert McInnis wrote:

> https://github.com/tiny/boost_observers.git

What are the advantages of this library over Boost.Signals2 [1]?

Same question with regards to the Boost.Synapse [2] proposal.

My impression from a brief look at your repository is that you need to
focus more on thread-safety.

Is there any way to avoid the overhead of thread synchronization in a
single-threaded application?

Observers are invoked while the mutex is locked, so observers cannot
make calls on the subject.

How does the lock-free mutex perform, especially when congested?

Why is the lock-free mutex recursive?

There are several member variables that are used as if they are atomic
but they are not declared as such, e.g. Subject::_block, Numeric<T>::_x
(think T == long long.)

The Scope template can be replaced by lock_guard if you model the
LockFreeMutex after the BasicLockable concept [3].

The thread_self() and thread_pid() functions can be replaced by
this_thread::get_id().

Replace the hAtomic macro with a type alias.

Use <cstdint> instead of <stdint.h> to reduce polution of the global
namespace.

[1] http://www.boost.org/doc/html/signals2.html
[2] http://zajo.github.io/boost-synapse/
[3] http://en.cppreference.com/w/cpp/concept/BasicLockable


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk