I'd say it's perfectly OK to spawn a thread from a constructor, and a horribly bad idea to have an endless loop in the constructor.
In code, the following is OK:
void start_a_thread_with_a_loop()
{
while(1)
{
// consider a while(!stop_condition) or something
// do something in a loop
}
}
class x
{
public:
x()
{
start_a_thread_with_a_loop();
}
};
And the following would be at least a bad idea:
class x
{
public:
x()
{
while(1)
{
}
}
};
Good thing though, is that likely you wouldn't be able to use such object, for reasons Neil pointed out :)