There is a function F , to the input of which 2 files are given. It processes them and saves these 2 files already changed to disk, instead of old ones.
The number of CPU cores is known to be N
There is a list of files in the amount of M , of which an array of pairs was obtained using the number of combinations of M through 2 . This array is divided into successive tasks, each of which contains N disjoint pairs.
How in Python to organize a call to this function F for all N cores of the CPU, provided that each such multicore call is with disjoint pairs of files (this is already implemented as a prepared array of tasks). After processing, the function saves these 2*N files, and is launched with the following files.
That is, how to organize вызов функции для N ядер -> ожидание завершения работы функции вызов функции для N ядер ожидание завершения работы функции -> the следующий вызов ?
It is necessary to implement this without using any complex structures or modules, such as multi-threaded classes or whatever they are.