Can anyone tell me are boost::signals
slots called synchronously or asynchronously?
For example I have this piece of code:
struct Hello
{
void operator()() const
{
std::cout << "Hello ";
}
};
struct World
{
void operator()() const
{
std::cout << " world!" << std::endl;
}
};
boost::signal<void ()> sig;
sig.connect(Hello());
sig.connect(World());
sig();
cout << "Foo";
How does the execution thread work? Does the execution wait for Hello()
and World()
to execute and just after that "Foo"
is printed or does it call them asynchronously(printing "Foo" and calling Hello()
and World()
execute in an undefined order)?