C++ thread destroy

Joined
Sep 4, 2022
Messages
128
Reaction score
16
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.

 
Joined
Feb 12, 2024
Messages
13
Reaction score
0
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.

but why does it wait for the thread? if it gets detached shouldn't it be on its own process?
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top