Boost logo

Boost Users :

Subject: [Boost-users] [boost.signals2] queries
From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2011-02-21 10:22:10


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.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net