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?.
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?.
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