I have a doubt about threading basics. If I launch a new thread T1, the main thread has to wait for T1 to join or can continue its execution without waiting?.
If it has to wait, can I make both the main and the new threads run asynchronously?.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you does not call
join()both thread executes concurrently. By default threads runs asynchronously.join()blocks the calling thread until a thread terminates.I would like to add to make thread execute synchronised, concurrency control mechanisms are provided.
One can explore about POSIX Threads Programming