英文版 C sharp C# thread Part 1 Getting Started Overview and Concepts ............................................................................................................. 3 How Threading Works .... ...........................................
之前用python的多线程,总是处理不好进程和线程之间的关系。后来发现了join和setDaemon函数,才终于弄明白。下面总结一下。
1.使用join函数后,主进程会在调用join的地方等待子线程结束,然后才接着往下执行。
join使用实例如下:
import time
import random
import threading
class worker(threading.Thread):
def __init__(self):
threading.Thread.__init