pthread cout issue

I have a multithreaded program. At the code below, the first cerr gets printed, but cout at the end doesn't get printed. When I move the cout line before the pthread_exit() it works but I get plenty of memory errors. I tried cout.flush() but it didn't work.

1
2
3
cerr << "Accoumulated time: " << elapsed.count() << endl;
pthread_exit(NULL);
cerr << result << endl;
Last edited on
> At the code below, the first cerr gets printed, but cout at the end doesn't get printed.
there is no cout in your code
¿what do you think pthread_exit() does?
If you want us to be able to help you, you need to post more code than just those three lines. Then we can examine it and provide feedback.

Thanks!
max
Topic archived. No new replies allowed.