Hi:

I am looking in to using boost.signals2 for a project I’m involved in, but have a few queries:

Firstly, if I create a global signall:

 

  boost::signals2::signal<void ()> sig;

and then a structure:
struct DoWork
{
  void operator()() const
  {
//work.
  }

If I then create a private member of a class:

DoWork work;

And then do:

Sig.connect(Work);

Will the connection happen on the thread in which the work member variable was defined or will a second thread be utilized?

Also given that sig will be a global and hence accessed from multiple threads, do I need a mutex?

Cheers

Sean.