- Joined
- Feb 12, 2024
- Messages
- 13
- Reaction score
- 0
do you need to join a thread after the .detach() method call to destroy the thread instance?
but why does it wait for the thread? if it gets detached shouldn't it be on its own process?a thread instance can be destroy at anytime.
the .join() method is about waiting for the Thread to end its work... ( synchronous )
Once you .detach() a thread ( asynchronous ) , this thread is out of the main Thread and can last without main Thread instance.
std::thread::detach - cppreference.com
en.cppreference.com
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.