Although there are is a lot of information on multiprocessing, I can't figure out the right way for my problem:
I have a function that calculates some data - takes about 5 seconds each time. I need to run this function between 2 and 100 times. The function can be run independently, so if one call takes 20 seconds and another only 3, that does not matter for the end result. This case is more than perfect for a multiprocessing setup. But starting 100 processes in parallel for 100 function-calls does not make sense to me.
What is the keyword I'm looking for? Queue, Pool, Manager? I want to calculate always x cases at the time, depending on the number of cores a system has. Once one of those calculations is done and the CPU has a free core, it should take the next case out of a list and hit the transistors again. Once all of them are done, I would like to access the outputs.
Thanks in advance!