I try to use simple way to make mulitiprocessing:
urls = [1, 2, 3, 4]
p = Pool(2)
p.map(open, urls)
Where open()
is function, that does calculations.
def open(url):
print(url)
When I do print(url)
it returns me strange result:
1
2
3
4
1
2
3
4
I can assume that each of process Pool(2)
handler the same calculations there is wrong.
I need that process 1 takes [1, 2]
for handling and process 2 takes [3, 4]