Join function in the thread module in Python

Source: Internet
Author: User

Http://www.cnblogs.com/vingi/articles/2657790.html

 for  in range:        = threadtest (i)        thread_arr.append (t)    for in range :        thread_arr[i].start (    )for in range:        Thread_arr[i].join ()

Simply put, the blocking process directs the thread to complete execution. The common practice is that we start a batch of threads and finally join these threads to the end.

Summarize:
The purpose of the 1 join method is to block the main process from executing a JOIN statement, to focus on multi-threaded execution, and to wait until the multithreaded execution is complete before the main thread's statement executes.
2 Multi-threaded multi-join cases, execute each thread's join method sequentially, before the last one is executed.
3 without parameters, the next thread's join is not started until the thread ends.
4 after the parameter is set, the thread waits for n seconds, regardless of whether the thread is finished or not, to begin executing the subsequent main process.

Join function in the thread module in Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.