parallel processing in python
module | usage |
threading
|
t1 = threading.Thread(target=print_square, args=(10,))
t1.start()
t1.join()
|
concurrent.futures
|
pool = concurrent.futures.ThreadPoolExecutor(max_workers=2)
pool.submit(worker)
pool.shutdown(wait=True)
|
multiprocessing
|
p1 = multiprocessing.Process(target=worker1)
p1.start()
p1.join()
|
subprocess.Popen
|
p1 = subprocess.Popen("ls")
p1.wait()
|
Multithreading in Python - GeeksforGeeks: https://www.geeksforgeeks.org/multithreading-python-set-1/