Home > Back-end > About the join in the thread blocking problem
About the join in the thread blocking problem
Time:12-04
The join of blocking exactly what that means? Why are the following two pieces of code in vs performed on the effect is not the same?
Thread the t1 (func); Thread t2 (func); The thread t3 (func); Thread t4 (func); Thread t5 (func); T1. The join (); T2. The join (); T3. The join (); T4. The join (); T5. The join ();
Thread the t1 (func); T1. The join (); Thread t2 (func); T2. The join (); The thread t3 (func); T3. The join (); Thread t4 (func); T4. The join (); Thread t5 (func); T5. The join ();
CodePudding user response:
Each thread is independent, is not the same as normal, isn't it? So the access of data needs to be locked in a thread, synchronization signal