python multiprocessing map mishandling of last processes
问题 There is a strange behavior of map when using Python's multiprocessing.Pool . In the example below a pool of 4 processors will work on 28 tasks. This should take seven passes, each taking 4 seconds. However, it takes 8 passes. In the first six passes all processors are engaged. In the 7th pass only two tasks are completed (two idling processors). The remaining 2 tasks are finished in the 8th pass (two idling processors, again). This behavior appears for seemingly random combinations of number