C++ thread destroy

Joined
Sep 4, 2022
Messages
133
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

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top