I'm building a small Python framework to run some experiments; I want to be able to launch many (>50
) applications concurrently. However, I also want to be able to simulate different applications arriving at different times.
The quick and dirty way to do this would be to spawn a new Process object every time a new application arrives. The more refined answer is to use Process Pools (and cut down on the number of objects created). I've used both in the past, so I understand the basics of each.
What I'm unsure of is how to expand a Pool dynamically, such that if a Process object is unavailable, a new one is spawned and the Pool expands; but if a Process object is available, it's reused appropriately.
Is there a data structure -- or an object -- in Python's multiprocessing
library to accomplish this?