Please refer to the following test code.
my questions are:
the input sequence is: 0, 1, 2,…9. is the output of p.map the same as 0, 1, 2, …9? if the input to p.map is not in order, how could I know the output and input corresponding relationship?
def pool_job(input_val=0): return [os.getpid(), input_val] def test_pool(): inlist = list(range(10)) with Pool(10) as p: ret = p.map(pool_job, inlist) print(ret) return if __name__ == '__main__': test_pool()