Closed mourendxu closed 4 years ago
I switched my code to joinable thread, the problem went away.
Great! Thanks for the update!
Oh, I was hoping an explanation why that is? :D
Thanks
Without concrete source code it is hard to guess. A joinable thread seems most appropriate, however, as the resources are properly and predictably cleaned-up.
Cheers
Ahh ok. Thanks. When I am ready to release the code, I might re-open this.
Thank you for your reply.
Hi, has anybody ran into this issue?
I wrote an external that uses a detached thread. I then used condition variable and locks to coordinate the exit of the detached thread. Both the main thread and the detached thread print a notification to the console right before they return/exit. All the statements were printed to the console in the correct order.
Yet, when I try to close Max, it would go into background process, stay there, take up about 17-18% of CPU. I tried to debug that thread once, and I got a bunch of memory access violations.
I used the same scheme for another program, and everything seems to be fine there.
I am quite confounded as to why this is.
Thank you.