File size: 219 Bytes
0fdb130
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from multiprocessing import Pool, freeze_support, cpu_count

def f(x, y):
    return x*x + y

if __name__ == '__main__':
    with Pool(5) as p:
        print(p.starmap(f, [[1, 1], [2, 1],[3, 1]]))
    print(cpu_count())