- Using pool() is the easiest way to work with multiprocessing, as you don't have to think about manually spawning processes and controlling interaction between them. Obviously, this limits your programs somewhat, as you have to figure out how to write your programs to take advantage of pool(), whereas manual control gives you a little more leeway. multi_process_retrieval.py demonstrates how pool() can be used to allocate work:
import urllib.request, urllib.error from multiprocessing.dummy import Pool import time start_time = time.time() urls = ["https://www.python.org", "https://www.google.com", "https://www.techdirt.com", "https://www.facebook.com", "https://www.ibm.com", "https://www.dell.com", "https://www.amd.com", ...