pthread cout issue

Mar 18, 2021 at 10:12pm
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 Mar 18, 2021 at 10:12pm
Mar 18, 2021 at 10:58pm
> 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?
Mar 18, 2021 at 11:28pm
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.