Closed ssotobayashi-m closed 2 years ago
Hi, thank you for your feedback!
Yes, the partition only works when font_num_per_process
> process_nums
, i.e., the number of fonts is very big.
It seems to be correct to use the following code:
Processes = [mp.Process(target=process, args=(pid, font_num_per_process + 1)) for pid in range(process_nums)].
I will update it when I have tested it.
Hi, I'm encountering the problem in the title.
For example, if
mp.cpu_count()=8
and you have 8 fonts underfont_ttfs/test
, one font will not be processed. In this case,process_nums=6
andfont_num_per_process=1
.will launch 7 processes, but they will each process one font, so only 7 fonts will be processed in total.
It's not a pretty solution, but it seems to work by having the process with the largest pid handle all the remaining fonts, as shown below: