So I have been using boost as a solution for threading. I seem to be having an issue where the threads I create dont let the main thread that was executing them continue. Eg:
int main(){
while(1){
speech listen; //create speech object
boost::thread speech_thd(boost::bind(&speech::Run,&listen));
speech_thd.join();
std::cout<<"test\n";
//Some sleep call here
}
The "test" call is only printed after speech_thd finishes execution. How would I create it such that I get execution on the main while(1) as well? If I can do this I will obviously move the thread creation outside the while(1) :P Thanks for any help!