Multiprocessing, Pool.map() Multiprocessing, Pool.map() python-3.x python-3.x

Multiprocessing, Pool.map()


The problem is that log_in is a function that takes two arguments, but your code passes just a single argument to that function: a list with two elements. Try Pool.starmap instead of Pool.map:

p.starmap(log_in, list)

From the documentation of Pool.starmap():

Like map() except that the elements of the iterable are expected to be iterables that are unpacked as arguments.

Hence an iterable of [(1,2), (3, 4)] results in [func(1,2), func(3,4)].