python多线程很牛逼
import time
from multiprocessing.dummy import Pool as ThreadPool
def process(item):
#print('正在并行for循环')
print(item)
#time.sleep(5)
items = [0]*100000
pool = ThreadPool(8)
pool.map(process, items)
pool.close()
pool.join()
python多线程很牛逼
import time
from multiprocessing.dummy import Pool as ThreadPool
def process(item):
#print('正在并行for循环')
print(item)
#time.sleep(5)
items = [0]*100000
pool = ThreadPool(8)
pool.map(process, items)
pool.close()
pool.join()